You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by Steve via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/10/17 00:11:20 UTC
[Apache TVM Discuss] [Questions] Erroring in IRModule update function
Hi All,
I am trying to experiment with IRModule update function.
My goal is to update the IRModule with another relay function as follows, and it is throwing an error.
Any comments/suggestions? Thanks in advance.
````
def module_update():
x0 = relay.var('x0', shape = (5,1))
y0 = relay.var('x0', shape = (5,1))
sub0 = relay.op.subtract(x0, y0)
f0 = relay.Function([], sub0)
mod = tvm.IRModule({'func1', f0})
x1 = relay.var('x1', shape = (5,1))
y1 = relay.var('x1', shape = (5,1))
add1 = relay.op.add(x1, y1)
f1 = relay.Function([], add1 )
a = tvm.ir.GlobalVar('func2')
mod.uodate(a, f1) # ==> This line gives error.
```
Here is the error:
```
tvm._ffi.base.TVMError: Traceback (most recent call last):
File "C:\tvm\src\ir\module.cc", line 192
TVMError: Check failed: fv.size() == 0 (2 vs. 0) : There are free variables: [Var(x1, ty=TensorType([5, 1], float32)), Var(y1, ty=TensorType([5, 1], float32))] in function: #[version = "0.0.5"]
fn () {
free_var %x1: Tensor[(5, 1), float32];
free_var %y1: Tensor[(5, 1), float32];
add(%x1, %y1)
}
tvm._ffi.base.TVMError: Traceback (most recent call last):
File "C:\tvm\src\ir\module.cc", line 192
TVMError: Check failed: fv.size() == 0 (2 vs. 0) : There are free variables: [Var(x1, ty=TensorType([5, 1], float32)), Var(y1, ty=TensorType([5, 1], float32))] in function: #[version = "0.0.5"]
fn () {
free_var %x1: Tensor[(5, 1), float32];
free_var %y1: Tensor[(5, 1), float32];
add(%x1, %y1)
}
```
---
[Visit Topic](https://discuss.tvm.apache.org/t/erroring-in-irmodule-update-function/8202/1) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/9c53b6ddb07c3c5fd6d99b3816f352c9a64dee9d7e82652e47fdd66fb898aaa0).