Convert FP Models

Convert FP Models#

The xlnstorch.convert_model submodule provides utilities to convert torch models and layers to their analogues in xlnstorch. This is an experimental feature and is a work in progress. The range of supported layers and models is limited, and the conversion may not always be perfect.

Note

Currently, only sequential models (or normal modules that are defined squentially) are supported for conversion.

parse_sequential

Parses a PyTorch nn.Sequential model or an equivalent nn.Module that defines nn.Module children in a similar way.

build_lns_sequential

Create a new xlnstorch.nn.LNSSequential object where each layer is instantiated from xlnstorch.nn if available, otherwise from torch.nn.