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

fix: use torch.from_numpy() instead of torch.Tensor() to keep data type #2951

Merged
merged 3 commits into from Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bentoml/_internal/frameworks/common/pytorch.py
Expand Up @@ -167,7 +167,7 @@ def from_payload( # pylint: disable=arguments-differ

else:
ret = pickle.loads(payload.data)
return torch.Tensor(ret).requires_grad_(False)
return torch.from_numpy(ret).requires_grad_(False)

@classmethod
@inject
Expand Down