MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _pad_channel

Function _pad_channel

tensorpack/utils/viz.py:82–90  ·  view source on GitHub ↗
(plist)

Source from the content-addressed store, hash-verified

80 bgcolor = (bgcolor, bgcolor, bgcolor)
81
82 def _pad_channel(plist):
83 ret = []
84 for p in plist:
85 if len(p.shape) == 2:
86 p = p[:, :, np.newaxis]
87 if p.shape[2] == 1:
88 p = np.repeat(p, 3, 2)
89 ret.append(p)
90 return ret
91
92 plist = _pad_channel(plist)
93 shapes = [x.shape for x in plist]

Callers 1

_pad_patch_listFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…