ott.neural.networks.velocity_field.VelocityField.is_initializing

ott.neural.networks.velocity_field.VelocityField.is_initializing#

VelocityField.is_initializing()#

Returns True if running under self.init(…) or nn.init(…)().

This is a helper method to handle the common case of simple initialization where we wish to have setup logic occur when only called under module.init or nn.init. For more complicated multi-phase initialization scenarios it is better to test for the mutability of particular variable collections or for the presence of particular variables that potentially need to be initialized.

Return type:

bool