Can a model serialized by torch.jit.trace be used for training? In the documentation it seems the ScriptModule is intented for inference and only training example is for torch::nn::Module. I wonder if training with ScriptModule is officially supported and is there documentation on that.
Related:
  
    
    
    Can ScriptModule be used for training? 
  
  
    Can ScriptModule be used for training? The reason we ask this question is that we found some source code related back propagation in torch.jit. https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/autodiff.cpp#L1151
  


  

      github.com/pytorch/pytorch
  

  
    
  
	  
  

  
    
      Document whether it is possible to train TorchScript modules 1
    

    
      
        opened 
        
          
        
        Mar 1, 2019
      
      


      
        
          
          martinruenz
        
      
    

    
        
          oncall: jit
        
        
          module: docs
        
        
          module: cpp
        
        
          triaged
        
    
  


  
    ## 📚 Documentation

I am interested in the following workflow, but my impressi…on is that this use case is not supported (yet?):

1. Prototype a model in **Python**
2. Export model to **C++** via TorchScript (`torch.jit.trace`)
3. Train model in **C++**

Based on the documentation, it is unclear whether this workflow is supported or not. The very first sentence of https://pytorch.org/docs/master/jit.html states

> TorchScript is a way to create serializable and **optimizable models** from PyTorch code

However, it is ambiguous if "**optimizable**" refers to training or the jit compilation process here. 

It seems that `torch::jit::script::Module` is treated as a special case which does not share commonality / a base class with `torch::nn::Module`. Is there also a way to access the parameters of a `torch::jit::script::Module` in order to use it for training? At first I thought "**optimizable models**" was referring to this but I am unsure now.

This issue is related to the post: https://discuss.pytorch.org/t/can-scriptmodule-be-used-for-training/35932


cc @suo @yf225