# From PyTorch

## About PyTorch

![](/files/QC1nB2Nwo93nrSx4kgS3)

[PyTorch](https://pytorch.org) is a [machine learning](https://en.wikipedia.org/wiki/Machine_learning) [framework](https://en.wikipedia.org/wiki/Software_framework) based on the [Torch](https://en.wikipedia.org/wiki/Torch_\(machine_learning\)) library, used for applications such as [computer vision](https://en.wikipedia.org/wiki/Computer_vision) and [natural language processing](https://en.wikipedia.org/wiki/Natural_language_processing), originally developed by [Meta AI ](https://en.wikipedia.org/wiki/Meta_AI)and now part of the [Linux Foundation](https://en.wikipedia.org/wiki/Linux_Foundation) umbrella. It is [free and open-source software](https://en.wikipedia.org/wiki/Free_and_open-source_software) released under the [modified BSD license](https://en.wikipedia.org/wiki/Modified_BSD_license). Although the [Python](https://en.wikipedia.org/wiki/Python_\(programming_language\)) interface is more polished and the primary focus of development, PyTorch also has a [C++](https://en.wikipedia.org/wiki/C%2B%2B) interface.

## Model deployment from PyTorch

Model deployment from PyTorch is simple to achieve by exporting your PyTorch model to ONNX and subsequently using (if neccesary) the `sclblonnx` package to [clean and check the resulting graph](/nx-ai-manager-v4.x/for-data-scientists/onnx-requirements.md#automatic-checking-using-the-sclblonnx-check-function) for an upload to the Nx AI cloud.&#x20;

* You can find details on PyTorch to ONNX exports [here](https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html). You can find an insightful tutorial [here](https://deci.ai/blog/how-to-convert-a-pytorch-model-to-onnx/).
* You can find an example using PyTorch and sclblonnx [here](https://github.com/scailable/sclblonnx/blob/master/examples/example_03.py).

After obtaining a [clean ONNX graph that adheres to our requirements](/nx-ai-manager-v4.x/for-data-scientists/onnx-requirements.md), you can [upload it to the Nx AI cloud](/nx-ai-manager-v4.x/nx-ai-cloud/upload-your-model.md) for deployment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nx.docs.scailable.net/nx-ai-manager-v4.x/for-data-scientists/importing-models/from-pytorch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
