Skip to content

cuda.FloatTensor constructor with float32 array #1957

@wjaskowski

Description

@wjaskowski
FloatTensor(np.array([0,1,2], dtype=np.float64))
cuda.FloatTensor(np.array([0,1,2], dtype=np.float64))
FloatTensor(np.array([0,1,2], dtype=np.float32))

work as expected, while

cuda.FloatTensor(np.array([0,1,2], dtype=np.float32))

fails with
RuntimeError: tried to construct a tensor from a float sequence, but found an item of type numpy.float32 at index (0)

PyTorch version: 0.1.12_2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions