How to use the nncf.utils.dict_update function in nncf

To help you get started, we’ve selected a few nncf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencv / openvino_training_extensions / pytorch_toolkit / nncf / nncf / layers.py View on Github external
def from_module(module):
        assert module.__class__.__name__ == nn.Conv2d.__name__
        nncf_conv = NNCFConv2d(
            module.in_channels, module.out_channels, module.kernel_size, module.stride,
            module.padding, module.dilation, module.groups, hasattr(module, 'bias')
        )
        nncf.utils.dict_update(nncf_conv.__dict__, module.__dict__)
        return nncf_conv
github opencv / openvino_training_extensions / pytorch_toolkit / nncf / nncf / layers.py View on Github external
def from_module(module):
        assert module.__class__.__name__ == nn.ConvTranspose3d.__name__
        args = [module.in_channels, module.out_channels, module.kernel_size, module.stride,
                module.padding, module.output_padding, module.groups, hasattr(module, 'bias'),
                module.dilation]
        if hasattr(module, 'padding_mode'):
            args.append(module.padding_mode)
        nncf_conv_transpose3d = NNCFConvTranspose3d(*args)
        nncf.utils.dict_update(nncf_conv_transpose3d.__dict__, module.__dict__)
        return nncf_conv_transpose3d