Skip to content

Mixed numpy-pytorch binary operators produce unexpected results #1819

@stepelu

Description

@stepelu

Test case (the order is important):

print(type(numpy.exp(1) + Variable(torch.zeros(2, 5))))
# <class 'numpy.ndarray'> (of really strange shape)

I understand why this is happening but I'd prefer an error to be thrown here if possible when the "expected" behaviour cannot be achieved.

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