Skip to content
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

slice op error when axis = -1 #84

Closed
talebolano opened this issue Apr 30, 2022 · 3 comments
Closed

slice op error when axis = -1 #84

talebolano opened this issue Apr 30, 2022 · 3 comments

Comments

@talebolano
Copy link

talebolano commented Apr 30, 2022

当使用ppq量化onnx模型时产生报错:

"ppq/executor/op/torch/default.py" , line 959
    new_axes = [ x if x >= 0 else len(data.dim()) + x for x in axes]
TypeError: object of type 'int' has no len()

貌似是slice的axis为-1时产生的问题

@ZhangZhiPku
Copy link
Collaborator

放假了别卷了,放完假再卷吧

@talebolano
Copy link
Author

talebolano commented Apr 30, 2022

放假了别卷了,放完假再卷吧

去掉len()貌似正确了

new_axes = [ x if x >= 0 else data.dim() + x for x in axes]

@ZhangZhiPku
Copy link
Collaborator

问题已经在新的pr中得到修复 #88

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

No branches or pull requests

2 participants