Skip to content

Cannot register customized Linear layer #4

@llCurious

Description

@llCurious

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions