From 19e609948300713e831129d89595fe03176ff698 Mon Sep 17 00:00:00 2001 From: Yishuo Wang Date: Wed, 10 Aug 2022 09:54:56 +0800 Subject: [PATCH] supplement the doc of torchnano (#5348) --- docs/readthedocs/source/doc/Nano/QuickStart/pytorch_nano.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/readthedocs/source/doc/Nano/QuickStart/pytorch_nano.md b/docs/readthedocs/source/doc/Nano/QuickStart/pytorch_nano.md index 613c9dc5..b26b6725 100644 --- a/docs/readthedocs/source/doc/Nano/QuickStart/pytorch_nano.md +++ b/docs/readthedocs/source/doc/Nano/QuickStart/pytorch_nano.md @@ -111,6 +111,7 @@ We only need the following steps: - copy all lines of code into the `train` method of `MyNano` - add one line to setup model, optimizer and dataloader - replace the `loss.backward()` with `self.backward(loss)` +- (**optional, only required when you use custom fields or methods of the model**) after calling `self.setup`, the returned model is a wrapper module around the original one which only has some common methods, such as `train`, `forward`, etc. if you need to access other fields or methods of the original model, you can replace the `model.xxxx` with `model.module.xxxx` ```python import os