(tensor, idx)
| 664 | # Helper method to return the `idx`-th dimension of `tensor`, along with |
| 665 | # a boolean signifying if the dimension is dynamic. |
| 666 | def _get_dim(tensor, idx): |
| 667 | static_shape = tensor.get_shape().dims[idx].value |
| 668 | if static_shape is not None: |
| 669 | return static_shape, False |
| 670 | return array_ops.shape(tensor)[idx], True |
| 671 | |
| 672 | # Get the height, width, depth (and batch size, if the image is a 4-D |
| 673 | # tensor). |
no test coverage detected