  which comes pre-configured on AWS Deep Learning AMI.
Converting a Model for AWS Neuron
Using the same script as in Using TorchScript in Python 
to trace a "BertModel", you import torch.neuron framework extension to access 
the components of the Neuron SDK through a Python API.
python
from transformers import BertModel, BertTokenizer, BertConfig
import torch
import torch.neuron
And only modify the tracing line of code
from:
python
torch.jit.trace(model, [tokens_tensor, segments_tensors])
to:
python
torch.neuron.trace(model, [token_tensor, segments_tensors])
This change enables Neuron SDK to trace the model and optimize it to run in Inf1 instances.
To learn more about AWS Neuron SDK features, tools, example tutorials and latest updates, 
please see the AWS NeuronSDK documentation.
