mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][PYFMT] migrate PYFMT for test/[a-h]*/ to ruff format (#144555)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/144555 Approved by: https://github.com/ezyang ghstack dependencies: #144551, #144554
This commit is contained in:
committed by
PyTorch MergeBot
parent
e600e044a7
commit
6d5c789ad5
@ -78,9 +78,9 @@ def _kernel_fallback(op, *args, **kwargs):
|
||||
elif op._schema.is_mutable or op is torch.ops.aten._copy_from.default:
|
||||
# Only handle inplace ops returning their first arg
|
||||
assert len(args) >= 1, f"Inplace {op} needs at least one arg"
|
||||
assert (
|
||||
len(op._schema.returns) == 1
|
||||
), f"NYI Inplace {op} with more than one return"
|
||||
assert len(op._schema.returns) == 1, (
|
||||
f"NYI Inplace {op} with more than one return"
|
||||
)
|
||||
op_name = op.overloadpacket._qualified_op_name
|
||||
real_res = args[0]
|
||||
elif any(r.alias_info is not None for r in op._schema.returns):
|
||||
|
||||
@ -67,7 +67,7 @@ def prepare_for_sending(args, kwargs):
|
||||
def convert(obj):
|
||||
if type(obj) not in VALID_QUEUE_TYPES_IN:
|
||||
raise RuntimeError(
|
||||
f"Cannot send object of type {type(obj)} " "over openreg device pipe."
|
||||
f"Cannot send object of type {type(obj)} over openreg device pipe."
|
||||
)
|
||||
|
||||
if isinstance(obj, torch.Tensor):
|
||||
@ -82,8 +82,7 @@ def receive_after_sending(allocator, args, kwargs):
|
||||
def convert(obj):
|
||||
if type(obj) not in VALID_QUEUE_TYPES_OUT:
|
||||
raise RuntimeError(
|
||||
f"Received invalid object of type {type(obj)} "
|
||||
"over openreg device pipe."
|
||||
f"Received invalid object of type {type(obj)} over openreg device pipe."
|
||||
)
|
||||
|
||||
if isinstance(obj, OpenRegTensorMeta):
|
||||
|
||||
Reference in New Issue
Block a user