(*args, **kwargs)
| 327 | name = fn.__name__ |
| 328 | |
| 329 | def check_cl(*args, **kwargs): |
| 330 | was_cl = contains_cl(args) |
| 331 | try: |
| 332 | result = fn(*args, **kwargs) |
| 333 | except Exception as e: |
| 334 | print("`{}` inputs are:".format(name)) |
| 335 | print_inputs(args) |
| 336 | print("-------------------") |
| 337 | raise e |
| 338 | failed = False |
| 339 | if was_cl: |
| 340 | if isinstance(result, torch.Tensor): |
| 341 | if result.dim() == 4 and not result.is_contiguous(memory_format=torch.channels_last): |
| 342 | print( |
| 343 | "`{}` got channels_last input, but output is not channels_last:".format(name), |
| 344 | result.shape, |
| 345 | result.stride(), |
| 346 | result.device, |
| 347 | result.dtype, |
| 348 | ) |
| 349 | failed = True |
| 350 | if failed and True: |
| 351 | print("`{}` inputs are:".format(name)) |
| 352 | print_inputs(args) |
| 353 | raise Exception("Operator `{}` lost channels_last property".format(name)) |
| 354 | return result |
| 355 | |
| 356 | return check_cl |
| 357 |
nothing calls this directly
no test coverage detected