New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relay] Global reduce fails to compile #2411

Closed
reminisce opened this Issue Jan 10, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@reminisce
Copy link
Contributor

reminisce commented Jan 10, 2019

I was trying to use relay.sum to perform global reduction on a tensor, but it fails to compile. I also noticed that this use case is skipped in the unit test. Is this a bug or a known issue of Relay?

def test_relay_sum():
    ctx = tvm.cpu()
    target = tvm.target.create('llvm')
    shape = (3, 4)
    x = relay.var('x', shape=shape)
    y = relay.sum(x)
    func = relay.Function([x], y)
    x_data = np.random.rand(*shape).astype('float32')
    intrp = relay.create_executor("debug", ctx=ctx, target=target)
    ret = intrp.evaluate(func)(x_data)
    print(ret)

Error message

tvm._ffi.base.TVMError: [15:03:02] src/runtime/module_util.cc:53: Check failed: ret == 0 (-1 vs. 0) Assert fail: (2 == tvm_struct_get(arg1, 0, 4)), arg1.ndim is expected to equal 2
@tqchen

This comment has been minimized.

Copy link
Member

tqchen commented Jan 15, 2019

seems that line of check is added by @siju-samuel as part of #2091

@tqchen

This comment has been minimized.

Copy link
Member

tqchen commented Jan 15, 2019

should be fixed by #2436

@tqchen tqchen closed this in #2436 Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment