Extends parent shape depending on subtensor's coordinates and shape * * @param parent_shape Parent shape * @param shape Subtensor shape * @param coords Subtensor coordinates inside parent tensor * * @return Extended parent shape */
| 40 | * @return Extended parent shape |
| 41 | */ |
| 42 | TensorShape extend_parent_shape(TensorShape parent_shape, TensorShape shape, Coordinates coords) |
| 43 | { |
| 44 | // Extend shape |
| 45 | for (unsigned int i = 0; i < TensorShape::num_max_dimensions; ++i) |
| 46 | { |
| 47 | int dimension_extend = coords[i] + static_cast<int>(shape[i]); |
| 48 | if ((dimension_extend > static_cast<int>(parent_shape[i])) && (dimension_extend > 0)) |
| 49 | { |
| 50 | parent_shape.set(i, static_cast<size_t>(dimension_extend)); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | return parent_shape; |
| 55 | } |
| 56 | } // namespace |
| 57 | |
| 58 | SubTensorInfo::SubTensorInfo() |