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

Class StaticDynamicAxis

tensorpack/models/shape_utils.py:9–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class StaticDynamicAxis(object):
10 def __init__(self, static, dynamic):
11 self.static = static
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))
23
24
25def DynamicLazyAxis(shape, idx):

Callers 1

applyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected