Summary:
During inference, the field modification makes the model not thread safe causing T109002515.
Q297197 recommends to remove this field. I have set the field self.p_attn to be updated during training only.
Also initializing self.p_attn = None caused issues during torchscript, hence initializing as torch.tensor(float("nan")) would fix this.
Summary: During inference, the field modification makes the model not thread safe causing T109002515. Q297197 recommends to remove this field. I have set the field self.p_attn to be updated during training only. Also initializing self.p_attn = None caused issues during torchscript, hence initializing as torch.tensor(float("nan")) would fix this.
Differential Revision: D33480478