torch.nn.utils.stateless.functional_call
- torch.nn.utils.stateless.functional_call(module, parameters_and_buffers, args=None, kwargs=None, *, tie_weights=True, strict=
Perform a functional call on the module by replacing the module parameters and buffers with the provided ones.
module (torch.nn.Module) – the module to call
parameters_and_buffers (dict of str and Tensor) – the parameters that will be used in the module call.
args (Any or tuple) – arguments to be passed to the module call. If not a tuple, considered a single argument.
kwargs (dict) – keyword arguments to be passed to the module call
tie_weights (bool, optional) – If True, then parameters and buffers tied in the original model will be treated as tied in the reparameterized version. Therefore, if True and different values are passed for the tied parameters and buffers, it will error. If False, it will not respect the originally tied parameters and buffers unless the values passed for both weights are the same. Default: True.
strict (bool, optional) – If True, then the parameters and buffers passed in must match the parameters and buffers in the original module. Therefore, if True and there are any missing or unexpected keys, it will error. Default: False.
the result of calling module.
Any