neural_compressor.adaptor.pytorch

Module Contents

Classes

TemplateAdaptor

Tample adaptor of PyTorch framework.

PyTorchAdaptor

Adaptor of PyTorch framework, all PyTorch API is in this class.

PyTorch_IPEXAdaptor

Adaptor of PyTorch framework with Intel PyTorch Extension,

PyTorch_FXAdaptor

Adaptor of PyTorch framework with FX graph mode, all PyTorch API is in this class.

PyTorchWeightOnlyAdaptor

Adaptor of PyTorch framework, all PyTorch API is in this class.

Functions

get_ops_recursively(model, prefix[, ops])

This is a helper function for graph_info,

neural_compressor.adaptor.pytorch.get_ops_recursively(model, prefix, ops={})[source]
This is a helper function for graph_info,

and it will get all ops from model.

Parameters:
  • model (object) – input model

  • prefix (string) – prefix of op name

  • ops (dict) – dict of ops from model {op name: type}.

Returns:

None

class neural_compressor.adaptor.pytorch.TemplateAdaptor(framework_specific_info)[source]

Tample adaptor of PyTorch framework.

Parameters:

framework_specific_info (dict) – dictionary of tuning configure from yaml file.

class neural_compressor.adaptor.pytorch.PyTorchAdaptor(framework_specific_info)[source]

Adaptor of PyTorch framework, all PyTorch API is in this class.

Parameters:

framework_specific_info (dict) – dictionary of tuning configure from yaml file.

class neural_compressor.adaptor.pytorch.PyTorch_IPEXAdaptor(framework_specific_info)[source]
Adaptor of PyTorch framework with Intel PyTorch Extension,

all PyTorch IPEX API is in this class.

Parameters:

framework_specific_info (dict) – dictionary of tuning configure from yaml file.

class neural_compressor.adaptor.pytorch.PyTorch_FXAdaptor(framework_specific_info)[source]

Adaptor of PyTorch framework with FX graph mode, all PyTorch API is in this class.

Parameters:

framework_specific_info (dict) – dictionary of tuning configure from yaml file.

class neural_compressor.adaptor.pytorch.PyTorchWeightOnlyAdaptor(framework_specific_info)[source]

Adaptor of PyTorch framework, all PyTorch API is in this class.

Parameters:

framework_specific_info (dict) – dictionary of tuning configure from yaml file.