MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / eval

Method eval

python/oneflow/nn/modules/module.py:781–797  ·  view source on GitHub ↗

r""" eval() Sets the module in evaluation mode. This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected, e.g. :class:`Dropout`, :class:`Bat

(self: T)

Source from the content-addressed store, hash-verified

779 return self
780
781 def eval(self: T) -> T:
782 r"""
783 eval()
784
785 Sets the module in evaluation mode.
786
787 This has any effect only on certain modules. See documentations of
788 particular modules for details of their behaviors in training/evaluation
789 mode, if they are affected, e.g. :class:`Dropout`, :class:`BatchNorm1d`,
790 etc.
791
792 This is equivalent with :meth:`self.train(False) <oneflow.nn.Module.train>`.
793
794 Returns:
795 Module: self
796 """
797 return self.train(False)
798
799 def requires_grad_(self: T, requires_grad: bool = True) -> T:
800 r"""Change if autograd should record operations on parameters in this

Callers 8

test_train_evalMethod · 0.95
mainFunction · 0.45
_test_fuse_conv_bnFunction · 0.45
_test_fold_multiplyFunction · 0.45
_test_fuse_conv_bnFunction · 0.45
TestSoftmaxFunction · 0.45
TestBroadcastMatmulFunction · 0.45
TestSoftmaxBackwardFunction · 0.45

Calls 1

trainMethod · 0.95

Tested by 8

test_train_evalMethod · 0.76
mainFunction · 0.36
_test_fuse_conv_bnFunction · 0.36
_test_fold_multiplyFunction · 0.36
_test_fuse_conv_bnFunction · 0.36
TestSoftmaxFunction · 0.36
TestBroadcastMatmulFunction · 0.36
TestSoftmaxBackwardFunction · 0.36