Skip to content

Why module->eval() doesn't work in C++ #21402

@kingaza

Description

@kingaza

❓ Questions and Help

There are dropout and batchnormalization layers in my module, therefore I use this in my cpp souce code:

    module->eval();

And module->is_training() shows now it is in eval mode.
However, the followed module->forward(inputs) returns different output for every time.

Does I miss something else?
thanks a lot.

ps, I even add these, although I don't think they are necessary

    torch::TensorOptions options;
    options.is_variable(false).requires_grad(false);

best regards,

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions