I have changed my model to jit version, when trace checking, I have a problem:
ERROR: Tensor-valued Constant nodes differed in value across invocations. This often indicates that the tracer has encountered untraceable code.
Node:
%out.1 : Tensor = prim::Constantvalue=, scope: DataParallel
Source Location:
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py(54): gather_map
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py(62): gather_map
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py(67): gather
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py(156): gather
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py(144): forward
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/modules/module.py(477): _slow_forward
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/nn/modules/module.py(487): call
/home/poli/anaconda2/envs/pytorch1.0py3/lib/python3.7/site-packages/torch/jit/init.py(635): trace
train_Kinetics.py(244): 
Comparison exception: 	Not within tolerance rtol=0.0001 atol=1e-05 at input[0, 108] (-10.839335441589355 vs. -15.760345458984375) and 3996 other locations (99.00%)
It looks like that in scatter_gather.py, a node in the function “gather_map” is treated as a constant assignment.