Skip to content

torch.full is inconsistent with np.full #27171

@zou3519

Description

@zou3519

🐛 Bug

https://docs.scipy.org/doc/numpy/reference/generated/numpy.full.html

Numpy does type inference on full but pytorch does not.

To reproduce

import torch
import numpy as np
print(torch.full((10, 1), 5).dtype)
print(np.full((10, 1), 5).dtype)

Gives:

torch.float32
int64

cc @ezyang @ssnl @gchanan

Metadata

Metadata

Assignees

Labels

module: bc-breakingRelated to a BC-breaking changemodule: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions