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

torch.Tensor -> torch.tensor #873

Merged
merged 4 commits into from
Dec 6, 2023
Merged

torch.Tensor -> torch.tensor #873

merged 4 commits into from
Dec 6, 2023

Conversation

edenlum
Copy link
Contributor

@edenlum edenlum commented Nov 30, 2023

Fixing loading bug where torch.Tensor(array(-1)) would try to create tensor of shape (-1) instead of a tensor with one entry at value -1. torch.tensor() has the expected behavior

Pull Request Description:

Checklist before requesting a review:

  • I set the appropriate labels on the pull request.
  • I have added/updated the release note draft (if necessary).
  • I have updated the documentation to reflect my changes (if necessary).
  • All function and files are well documented.
  • All function and classes have type hints.
  • There is a licenses in all file.
  • The function and variable names are informative.
  • I have checked for code duplications.
  • I have added new unittest (if necessary).

…a tensor of shape (-1) instead of a tensor with one entry at value -1. torch.tensor() has the expected behavior
In general, torch.Tensor is for uninitialized tensors, because all of our tensors are with values and the datatype is inferred (not explicit) we should use torch.tensor.
@edenlum edenlum merged commit 89c2591 into sony:main Dec 6, 2023
24 checks passed
@edenlum edenlum deleted the torch-tensor-fix branch December 6, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants