Torch.fx for torch.nn.Transformer

Hi all,

There is a error from torch.fx

import torch

model = nn.Transformer(nhead=16, num_encoder_layers=12)

gm = torch.fx.symbolic_trace(model)

torch.fx.proxy.TraceError: symbolically traced variable cannot be used as inputs to control flow.

How to deal it?