Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental authored Dec 10, 2024
1 parent 6516b48 commit b7f4f5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tuner/tuner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

from iree.compiler import ir

# substitute replace=True so that colliding registration don't error
def register_attribute_builder(kind, replace=True):
def decorator_builder(func):
AttrBuilder.insert(kind, func, replace=replace)
return func

return decorator_builder

ir.register_attribute_builder = register_attribute_builder

0 comments on commit b7f4f5a

Please sign in to comment.