mfai.pytorch¶
- mfai.pytorch.assign(left, right)[source]¶
Used when loading weights coming from another training framework in to pytorch models. Checks the shapes matches and creates the learnable parameters from the supplied weights (rights). Copied from the llm from scratch repo “as-is”.
- mfai.pytorch.export_to_onnx(model, sample, filepath, **kwargs)[source]¶
Exports a model to ONNX format.
- mfai.pytorch.onnx_load_and_infer(filepath, input)[source]¶
Loads a model using onnx, checks it, and performs an inference.