bitorch.layers.convert

bitorch.layers.convert(module: T, new_mode: RuntimeMode, device: Optional[device] = None, verbose: bool = False) T[source]

Convert the given module to a new bitorch RuntimeMode. Needs to have custom implementations installed.

Parameters:
  • module – the module to be converted

  • new_mode – the new mode for the module

  • device – an optional device

  • verbose – whether to print which layers are converted

Returns:

the converted module