CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the othe
(frm Tensor, to, start, n int)
| 286 | // values to copy. Uses an optimized implementation if the other tensor is |
| 287 | // of the same type, and otherwise it goes through appropriate standard type. |
| 288 | func (tsr *Bits) CopyCellsFrom(frm Tensor, to, start, n int) { |
| 289 | if fsm, ok := frm.(*Bits); ok { |
| 290 | for i := 0; i < n; i++ { |
| 291 | tsr.Values.Set(to+i, fsm.Values.Index(start+i)) |
| 292 | } |
| 293 | return |
| 294 | } |
| 295 | for i := 0; i < n; i++ { |
| 296 | tsr.Values.Set(to+i, Float64ToBool(frm.Float1D(start+i))) |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | // Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the |
| 301 | // 2D Matrix. Not supported for Bits -- do not call! |
nothing calls this directly
no test coverage detected