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

Method apply

tensorpack/models/shape_utils.py:14–19  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

12 self.dynamic = dynamic
13
14 def apply(self, f):
15 try:
16 st = f(self.static)
17 return StaticDynamicAxis(st, st)
18 except TypeError:
19 return StaticDynamicAxis(None, f(self.dynamic))
20
21 def __str__(self):
22 return "S={}, D={}".format(str(self.static), str(self.dynamic))

Callers 1

shape_utils.pyFile · 0.45

Calls 2

StaticDynamicAxisClass · 0.85
fFunction · 0.70

Tested by

no test coverage detected