(self, tensor)
| 32 | |
| 33 | class StaticDynamicShape(object): |
| 34 | def __init__(self, tensor): |
| 35 | assert isinstance(tensor, tf.Tensor), tensor |
| 36 | ndims = tensor.shape.ndims |
| 37 | self.static = tensor.shape.as_list() |
| 38 | if tensor.shape.is_fully_defined(): |
| 39 | self.dynamic = self.static[:] |
| 40 | else: |
| 41 | dynamic = tf.shape(tensor) |
| 42 | self.dynamic = [DynamicLazyAxis(dynamic, k) for k in range(ndims)] |
| 43 | |
| 44 | for k in range(ndims): |
| 45 | if self.static[k] is not None: |
| 46 | self.dynamic[k] = StaticLazyAxis(self.static[k]) |
| 47 | |
| 48 | def apply(self, axis, f): |
| 49 | if self.static[axis] is not None: |
nothing calls this directly
no test coverage detected