MCPcopy Create free account
hub / github.com/cogentcore/core / Projection2DValue

Function Projection2DValue

tensor/projection2d.go:140–143  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

138// Even multiples of inner-most dimensions are assumed to be row, then column.
139// RowMajor and ColMajor layouts are handled appropriately.
140func 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).

Callers 4

RenderMethod · 0.92
RenderMethod · 0.92
StringMethod · 0.85
StringMethod · 0.85

Calls 3

Projection2DIndexFunction · 0.85
ShapeMethod · 0.65
Float1DMethod · 0.65

Tested by

no test coverage detected