Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: cleanup whitespace and typo #3195

Merged
merged 1 commit into from Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/source/frameworks/pytorch.rst
Expand Up @@ -21,7 +21,7 @@ For common PyTorch models with single input:

.. code-block:: python
:caption: `train.py`
import bentoml
import torch
import torch.nn as nn
Expand Down Expand Up @@ -97,7 +97,7 @@ For common PyTorch models with single input:
bentoml.pytorch.save(
model,
"my_torch_model",
signatures={"__call__": {"batchable": True, "batchdim": 0}},
signatures={"__call__": {"batchable": True, "batch_dim": 0}},
)
Expand Down Expand Up @@ -126,7 +126,7 @@ For common PyTorch models with single input:
bentoml.pytorch.save(
model,
"my_torch_model",
signatures={"__call__": {"batchable": True, "batchdim": 0}},
signatures={"__call__": {"batchable": True, "batch_dim": 0}},
)
.. note::
Expand All @@ -136,7 +136,7 @@ For common PyTorch models with single input:
.. code-block:: python
:caption: `train.py`
:emphasize-lines: 1,8
import my_models
model = my_models.MyModel()
Expand All @@ -146,9 +146,9 @@ For common PyTorch models with single input:
signatures={"__call__": {"batchable": True, "batch_dim": 0}},
external_modules=[my_models],
)
This is due to a limitation from PyTorch model serialisation, where PyTorch requires the model's source code to restore it.

A better practice is to compile your model to `TorchScript <https://pytorch.org/docs/stable/jit.html>`_ format.

.. note::
Expand Down