src/transformers/utils/import_utils.py/is_torch_fx_proxy
def is_torch_fx_proxy(x):
    if is_torch_fx_available():
        import torch.fx

        return isinstance(x, torch.fx.Proxy)
    return False