Pytoch JIT使用経験まとめ


注意
1.CPUモードを使ってTraceまたはjit.scriptを行うのは正常ですが、GPUモードを使ってエラーを確認します.
すべてのtouch.operatorは、dimを伝える必要があります.如き
torch.cat(tensors, dim=0, out=None) → Tensor
パラメータを送るには注意が必要です.dimは絶対に***=-1**できません.Traceを使うとCPUはすべて正常かもしれませんが、GPUを使ってTraceを行うとエラーが発生します.一般的に次のようなエラーがあります.
torch.jit.TracingCheckError: Tracing failed sanity checks!
Encountered an exception while running the trace with test inputs.
Exception:
	vector::_M_range_check: __n (which is 18446744073709551615) >= this->size() (which is 2)