(tensor, ndims=2)
| 46 | |
| 47 | |
| 48 | def _FlatInnerDims(tensor, ndims=2): |
| 49 | shape = list(tensor.shape) |
| 50 | return tensor.reshape([ |
| 51 | functools.reduce(lambda x, y: x * y, shape[:-ndims + 1], 1) |
| 52 | ] + shape[-ndims + 1:]) |
| 53 | |
| 54 | |
| 55 | def _FlatOuterDims(tensor, ndims=2): |
no test coverage detected