Automatically unwrap attributes access of _LiteModule (#5392)
* automatically unwrap attributes access of _LiteModule and add test for it * delete redundant documents
This commit is contained in:
		
							parent
							
								
									df75c72d91
								
							
						
					
					
						commit
						e62b8d1fc5
					
				
					 1 changed files with 0 additions and 1 deletions
				
			
		| 
						 | 
					@ -111,7 +111,6 @@ We only need the following steps:
 | 
				
			||||||
- copy all lines of code into the `train` method of `MyNano`
 | 
					- copy all lines of code into the `train` method of `MyNano`
 | 
				
			||||||
- add one line to setup model, optimizer and dataloader
 | 
					- add one line to setup model, optimizer and dataloader
 | 
				
			||||||
- replace the `loss.backward()` with `self.backward(loss)`
 | 
					- 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
 | 
					```python
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue