forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Relay] Alter Op Layout (apache#2150)
* [RELAY] Finish alter op pass * [RELAY] AlterOpLayout Pass * fix broadcast operators * fix broadcast operators * fix broadcast operators * Support concatenate * address comments * address comments * add comments * rebase
- Loading branch information
1 parent
7899616
commit a2bbe44
Showing
35 changed files
with
1,498 additions
and
217 deletions.
There are no files selected for viewing
Submodule HalideIR
updated
3 files
+3 −1 | src/arithmetic/Simplify.cpp | |
+15 −6 | src/tvm/node/container.h | |
+1 −0 | src/tvm/node/node.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" TVM Attribute module, which is mainly used for defining attributes of operators""" | ||
from ._ffi.node import NodeBase, register_node as _register_tvm_node | ||
from ._ffi.function import _init_api | ||
from . import _api_internal | ||
|
||
|
||
@_register_tvm_node | ||
class Attrs(NodeBase): | ||
"""Attribute node, which is mainly use for defining attributes of relay operators. | ||
Used by function registered in python side, such as compute, schedule and alter_layout. | ||
Attrs is passed as the first argument to these functions. | ||
""" | ||
def list_field_info(self): | ||
""" Get fields information | ||
Returns | ||
------- | ||
infos: list of AttrFieldInfo | ||
List of field information | ||
""" | ||
return _api_internal._AttrsListFieldInfo(self) | ||
|
||
def keys(self): | ||
"""Get list of names in the attribute. | ||
Returns | ||
------- | ||
keys : list of str | ||
List of keys | ||
""" | ||
fields = self.list_field_info() | ||
for field in fields: | ||
yield field.name | ||
|
||
def __getitem__(self, item): | ||
return self.__getattr__(item) | ||
|
||
|
||
_init_api("tvm.attrs") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""The attributes node used for Relay operators""" | ||
|
||
from ...attrs import Attrs | ||
from ..base import register_relay_attr_node | ||
|
||
@register_relay_attr_node | ||
class Conv2DAttrs(Attrs): | ||
"""Attribute of a Convolution Operator""" | ||
pass | ||
|
||
@register_relay_attr_node | ||
class GlobalPool2DAttrs(Attrs): | ||
"""Attribute of a Global 2D Pooling Operator""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.