1 原因
torchscript runtime在第一階段會進行最佳化
2 解決辦法
#include <torch/csrc/jit/python/update_graph_executor_opt.h>
torch::jit::setGraphExecutorOptimize(false);
參考:https://discuss.pytorch.org/t/speed-of-custom-rnn-is-super-slow/63209
torchscript runtime在第一階段會進行最佳化
#include <torch/csrc/jit/python/update_graph_executor_opt.h>
torch::jit::setGraphExecutorOptimize(false);
參考:https://discuss.pytorch.org/t/speed-of-custom-rnn-is-super-slow/63209