MCPcopy Create free account
hub / github.com/pytorch/tutorials / contains_cl

Function contains_cl

intermediate_source/memory_format_tutorial.py:304–312  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

302#
303#
304def contains_cl(args):
305 for t in args:
306 if isinstance(t, torch.Tensor):
307 if t.is_contiguous(memory_format=torch.channels_last) and not t.is_contiguous():
308 return True
309 elif isinstance(t, list) or isinstance(t, tuple):
310 if contains_cl(list(t)):
311 return True
312 return False
313
314
315def print_inputs(args, indent=""):

Callers 1

check_clFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected