Skip to content

[QNN] Fix qnn.dequantize scale and zp shape#10880

Merged
AndrewZhaoLuo merged 3 commits intoapache:mainfrom
sfvaroglu:sevin/dq_shape
Apr 5, 2022
Merged

[QNN] Fix qnn.dequantize scale and zp shape#10880
AndrewZhaoLuo merged 3 commits intoapache:mainfrom
sfvaroglu:sevin/dq_shape

Conversation

@sfvaroglu
Copy link
Contributor

The type checker fails with:

data = relay.const(np.ones(16, dtype="int8"))
scale = relay.const(np.ones(1, dtype="float32"))
zp = relay.const(np.ones(1, dtype="int32"))
op = relay.qnn.op.dequantize(data, scale, zp) 

print(relay.transform.InferType()(tvm.ir.IRModule.from_expr(op)))

This PR provides a fix.

@sfvaroglu
Copy link
Contributor Author

@mbrookhart @AndrewZhaoLuo

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some nits.

@AndrewZhaoLuo
Copy link
Contributor

PTAL @sfvaroglu

@AndrewZhaoLuo AndrewZhaoLuo self-assigned this Apr 5, 2022
Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndrewZhaoLuo AndrewZhaoLuo merged commit 8f664f5 into apache:main Apr 5, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
* [QNN] Fix qnn.dequantize scale and zp shape

* Rework

* Add review feedback
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Apr 11, 2022
* [QNN] Fix qnn.dequantize scale and zp shape

* Rework

* Add review feedback
Lucien0 pushed a commit to Lucien0/tvm that referenced this pull request Apr 19, 2022
* [QNN] Fix qnn.dequantize scale and zp shape

* Rework

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants