Skip to content

Is there a non-inplace version of nn.Tanh() #1321

@zhanghang1989

Description

@zhanghang1989

When I add nn.Tanh() to the last layer of a generative model, I got the error during the training RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation.
Is there a inplace=False option for nn.Tanh(). Thanks!

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