Skip to content

Commit

Permalink
Replace torch.jit.instance with instance to assist torch.compile
Browse files Browse the repository at this point in the history
Summary: torch.jit.instance is mainly needed to refine Generics, but in this case instance is sufficient, instance unlike torch.jit.instance is also playing nicely with torch.compile

Differential Revision: D53797660
  • Loading branch information
Yury Gitman authored and facebook-github-bot committed Feb 15, 2024
1 parent 6bf3779 commit e81a5e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchmultimodal/modules/layers/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _cross_attention_block(
# TODO: figure out caching for cross-attention
use_cache=False,
)
assert torch.jit.isinstance(
assert isinstance(
output, Tensor
), "cross-attention output must be Tensor."
attention_output = self.cross_attention_dropout(output)
Expand Down

0 comments on commit e81a5e5

Please sign in to comment.