Projection2DValue returns the float64 value at given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the
(tsr Tensor, oddRow bool, row, col int)
| 138 | // Even multiples of inner-most dimensions are assumed to be row, then column. |
| 139 | // RowMajor and ColMajor layouts are handled appropriately. |
| 140 | func Projection2DValue(tsr Tensor, oddRow bool, row, col int) float64 { |
| 141 | idx := Projection2DIndex(tsr.Shape(), oddRow, row, col) |
| 142 | return tsr.Float1D(idx) |
| 143 | } |
| 144 | |
| 145 | // Projection2DSet sets a float64 value at given row, col coords for a 2D projection |
| 146 | // of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). |