-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4946e7
commit 83a6ce3
Showing
5 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
Submodule HalideIR
updated
3 files
+4 −4 | src/ir/IR.h | |
+1 −1 | src/tvm/node/node.h | |
+0 −0 | src/tvm/runtime/node_base.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" Support level10 operator test cases. | ||
""" | ||
import tvm | ||
from tvm import relay | ||
|
||
def test_collapse_sum_like(): | ||
ib = relay.ir_builder.IRBuilder() | ||
x = ib.param("x", relay.ty.TensorType((3, 4, 5, 6), "int8")) | ||
y = ib.param("y", relay.ty.TensorType((4, 1, 6), "int8")) | ||
with ib.function(x, y) as func: | ||
ib.ret(relay.collapse_sum_like(x.var, y.var)) | ||
ib.ret(func) | ||
func = relay.ir_pass.infer_type(ib.env, func.to_func()) | ||
ftype = func.checked_type | ||
assert ftype.ret_type == relay.ty.TensorType((4, 1, 6), "int8") | ||
|
||
|
||
def test_broadcast_to_like(): | ||
ib = relay.ir_builder.IRBuilder() | ||
x = ib.param("x", relay.ty.TensorType((3, 4, 5, 6), "int8")) | ||
y = ib.param("x", relay.ty.TensorType((4, 1, 6), "int8")) | ||
with ib.function(x, y) as func: | ||
ib.ret(relay.broadcast_to_like(y.var, x.var)) | ||
ib.ret(func) | ||
func = relay.ir_pass.infer_type(ib.env, func.to_func()) | ||
ftype = func.checked_type | ||
assert ftype.ret_type == relay.ty.TensorType((3, 4, 5, 6), "int8") | ||
|
||
if __name__ == "__main__": | ||
test_collapse_sum_like() | ||
test_broadcast_to_like() |