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

Update mul(self, other): in _tt_base.py to allow multiplication with complex scalars and fix multiplication with torch.Tensor scalars #23

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

ausstein
Copy link
Contributor

@ausstein ausstein commented Jul 5, 2024

Fixes #24

Changes to
def mul(self, other):

for multiplication with scalar:

  • torch.tensor changed to torch.Tensor which is correct as a type. ( isinstance does not work with torch.tensor but does with torch.Tensor)

  • added complex scalars as a valid option

  • adjusted description and error message accordingly

Changes to
def __mul__(self, other):

for multiplication with scalar:

- torch.tensor changed to torch.Tensor which is correct as a type. ( isinstance does not work with torch.tensor but does with torch.Tensor)

- added complex scalars as a valid option

- adjusted description and error message accordingly
@ausstein ausstein changed the title Update _tt_base.py Update mul(self, other): in _tt_base.py to allow multiplication with complex scalars and fix multiplication with torch.Tensor scalars Jul 5, 2024
@ion-g-ion ion-g-ion merged commit ed45632 into ion-g-ion:main Jul 9, 2024
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.

Scalar multiplication with complex numbers and torch.Tensor Scalars
2 participants