交互式检查器:这段代码是否 Graph-Friendly?

output = torch.matmul(A, B) # A, B shape 固定
if x.item() > 0.5: output = branch_a(x)
y = F.layer_norm(x, normalized_shape=[512])
result = torch.cat(list_of_variable_tensors)
new_tensor = torch.empty(dynamic_batch, 512).cuda()
static_buf.copy_(new_data); out = model(static_buf)
print(f"Loss: {loss.item()}") # 在 capture 区域内

点击每一行代码来检查它是否 Graph-Friendly