Skip to content

Commit

Permalink
docs: cleanup whitespace and typo (#3195)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnphm committed Nov 7, 2022
1 parent 566220e commit 10a1101
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 10a1101

Please sign in to comment.