Skip to content

Comparison of tuples of namedtensors yields true #101

@samgoldman97

Description

@samgoldman97

I tried to compare the hidden state returned by an LSTM to a saved copy of the state previously to make sure the LSTM was not changing the state. Curiously, comparing the two hidden state tuples yielded True. I checked generally, and it seems that checking equality for tuples of named tensors always returns True. Here's an example:

(ntorch.randn((6,7), names=("dim2", "dim3")), ntorch.randn(5, names="dim1")) == (ntorch.randn(5, names="dim1"), ntorch.randn(5, names="dim1"))

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