def METHOD_NAME(disallowed_ops: Set[DisallowedOperator]):
    """
    Disallow certain operators in the fx graph produced by TorchDynamo.
    There are two ways to disallow operator in TorchDynamo,
    1. Use the disallow_in_graph API, which only applies to free function call.
    2. Patch the TensorVariable class, which applies to method call on torch.Tensor.
    """
    disallowed_tensor_methods: Set[str] = set()
    if DisallowedOperator.INPLACE_COPY in disallowed_ops:
        torchdynamo.disallow_in_graph(torch.Tensor.copy_)
        disallowed_tensor_methods.update({"copy_", "__setitem__"})
    if DisallowedOperator.EINSUM in disallowed_ops:
        torchdynamo.disallow_in_graph(torch.functional.einsum)
    if DisallowedOperator.MULTIHEAD_ATTENTION in disallowed_ops:
        torchdynamo.disallow_in_graph(torch.nn.MultiheadAttention)
    if DisallowedOperator.AS_STRIDE in disallowed_ops:
        disallowed_tensor_methods.add("as_stride")
    tensor_variable_cls = torchdynamo.variables.tensor.TensorVariable
    old_call_method = tensor_variable_cls.call_method
    @functools.wraps(old_call_method)
    def call_method(self, translator, name, args, kwargs):
        if name in disallowed_tensor_methods:
            raise torchdynamo.exc.Unsupported(f"Tensor.{name} not supported by TVM.")
        return old_call_method(self, translator, name, args, kwargs)
    tensor_variable_cls.call_method = call_method