TOC
model(x) vs model.forward(x)
__call__
magic method in nn.Module will invoke forward()
method and take care of hooks and states that python allows, so we should use model(x)
rather than call model.forward(x)
directly.
REFERENCE:
1.Why there are different output between model.forward(input) and model(input)
2.Calling forward function without .forward()
「点个赞」
点个赞
使用微信扫描二维码完成支付
