MCPcopy Index your code
hub / github.com/pytorch/pytorch / _MakeList

Function _MakeList

caffe2/python/control.py:39–55  ·  view source on GitHub ↗

input is a tuple. Example: (a, b, c) --> [a, b, c] (a) --> [a] ([a, b, c]) --> [a, b, c]

(input)

Source from the content-addressed store, hash-verified

37
38
39def _MakeList(input):
40 """ input is a tuple.
41 Example:
42 (a, b, c) --> [a, b, c]
43 (a) --> [a]
44 ([a, b, c]) --> [a, b, c]
45 """
46 if len(input) == 0:
47 raise ValueError(
48 'input cannot be empty.')
49 elif len(input) == 1:
50 output = input[0]
51 if not isinstance(output, list):
52 output = [output]
53 else:
54 output = list(input)
55 return output
56
57
58def _IsNets(nets_or_steps):

Callers 7

_PrependNetsFunction · 0.85
_AppendNetsFunction · 0.85
BoolNetFunction · 0.85
DoFunction · 0.85
DoParallelFunction · 0.85
SwitchFunction · 0.85
SwitchNotFunction · 0.85

Calls 2

isinstanceFunction · 0.85
listFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…