I solve this issue and leave this thread to someone who face same problem.
The reason of error is tensors generated in the model.
Dtype setting in python code with torch.set_default_dtype() is not saved in torchscript.
Thus, one need to set dtype explicitly to avoid type mismatch issue.
But torch.set_default_dtype() is still useful because it automatically set the dtype of network weights, biases, etc.