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

Cannot register customized Linear layer #4

Open
llCurious opened this issue Dec 16, 2021 · 0 comments
Open

Cannot register customized Linear layer #4

llCurious opened this issue Dec 16, 2021 · 0 comments

Comments

@llCurious
Copy link

Hey, i tried to run the demo code in transform_example.ipynb and no error occurred. However, when i add transformer.register(nn.Linear, QLinear), there is an error.

TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:

  • (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  • (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)`

And the error seems to result from the init function of Linear layer self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))

image

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

1 participant