Skip to content

Incorrect accuracy pytorch(1.0.1) and libtorch because of nn.LSTM #68864

@wuzuowuyou

Description

@wuzuowuyou

pytorch version1.0.1
libtorch version 1.0.1

...
self.lstm_1 = nn.LSTM(512 * 8, 100, 1, bidirectional=False)
...

traced_script_module = torch.jit.trace(net, img)
traced_script_module.save("./lstm20211124.pt")

and in c++ libtorch

torch::Tensor output = m_model->forward({tensor_input}).toTensor();

The output here is inconsistent with that of pytorch.
I have tested that the output results of the upper layer of LSTM are consistent

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionEnsure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions