__call__
is already defined in nn.Module
, will register all hooks and call your forward
. That’s also the reason to call the module directly (output = model(data)
) instead of model.forward(data)
.
11 Likes