Shortcuts

torchexpo.modules

class torchexpo.modules.ImageClassificationModule(model, model_name, model_example)[source]

Image Classification module for all vision models under vision/image_classification

Parameters
  • model – Pretrained model which is used for conversion

  • model_name – Name of the model

  • model_example – Example tensor used as example input while extraction

extract_onnx(opset_version=None)[source]

Extract onnx from image classification model

Parameters

opset_version – Opset version used while ONNX conversion

extract_torchscript()[source]

Extract torchscript module from image classification model

class torchexpo.modules.ImageSegmentationModule(model, model_name, model_example)[source]

Image Segmentation module for all vision models under vision/image_segmentation

Parameters
  • model – Pretrained model which is used for conversion

  • model_name – Name of the model

  • model_example – Example tensor used as example input while extraction

extract_onnx(opset_version=11)[source]

Extract onnx from image segmentation model

Parameters

opset_version – Opset version used while ONNX conversion

extract_torchscript()[source]

Extract torchscript module from image segmentation model

class torchexpo.modules.SentimentAnalysisModule(model, model_name, model_example)[source]

Sentiment Analysis module for all nlp models under nlp/sentiment_analysis

Parameters
  • model – Pretrained model which is used for conversion

  • model_name – Name of the model

  • model_example – Example tensor used as example input while extraction

extract_onnx(opset_version=None)[source]

Extract onnx from sentiment analysis model

Parameters

opset_version – Opset version used while ONNX conversion

extract_torchscript()[source]

Extract torchscript module from sentiment analysis model

class torchexpo.modules.TorchExpoModule(model, model_name, model_example)[source]

Base class for all PyTorch models

Parameters
  • model – Pretrained model which is used for conversion

  • model_name – Name of the model

  • model_example – Example tensor used as example input while extraction

extract_caffe2_mobile()[source]

Extracts model in Caffe2 Mobile format

extract_onnx(opset_version=None)[source]

Extracts model in ONNX format

Parameters

opset_version – Opset version used while ONNX conversion

extract_torchscript()[source]

Extracts model in TorchScript format

get_extracted_file_name()[source]

Returns file name for output

print_message(output_type)[source]

Prints message

Parameters

output_type – Name of the output format used for printing

Read the Docs v: latest
Versions
latest
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.