Skip to content

weird error msg when using non-scalar tensor as int64 #9419

@ssnl

Description

@ssnl
>>> import torch
>>> c = torch.randn(3)
>>> c.view(c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: view(): argument 'size' (position 1) must be tuple of ints, not Tensor
>>> c.view(1, c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: localScalar() called on Tensor with 3 elements

we shouldn't mention localScalar.

cc @gchanan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions