Skip to content

Conversation

@umanwizard
Copy link
Contributor

Another simple bit of syntax that NumPy supports and we don't.

Support int, float, and bool.

>>> torch.randn((2,3), dtype=float)
tensor([[-0.1752, -0.3240, -0.6148],
        [ 0.1861,  1.6472,  0.1687]], dtype=torch.float64)

A bit confusingly, Python's "float" actually means double, but nothing we can do about that.

@pytorchbot pytorchbot added module: internals Related to internal abstractions in c10 and ATen module: operators module: pybind Related to our Python bindings / interactions with other Python libraries labels May 31, 2019
@umanwizard umanwizard added the module: numpy Related to numpy support, and also numpy compatibility of our operators label May 31, 2019
@ezyang ezyang added facebook and removed facebook labels Jun 5, 2019
Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine although I don't think it will work with JIT.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@umanwizard has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@umanwizard merged this pull request in 0a3fb45.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: internals Related to internal abstractions in c10 and ATen module: numpy Related to numpy support, and also numpy compatibility of our operators module: pybind Related to our Python bindings / interactions with other Python libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants