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)
| 243 | // values to copy. Uses an optimized implementation if the other tensor is |
| 244 | // of the same type, and otherwise it goes through appropriate standard type. |
| 245 | func (tsr *String) CopyCellsFrom(frm Tensor, to, start, n int) { |
| 246 | if fsm, ok := frm.(*String); ok { |
| 247 | for i := 0; i < n; i++ { |
| 248 | tsr.Values[to+i] = fsm.Values[start+i] |
| 249 | } |
| 250 | return |
| 251 | } |
| 252 | for i := 0; i < n; i++ { |
| 253 | tsr.Values[to+i] = Float64ToString(frm.Float1D(start + i)) |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | // SubSpace returns a new tensor with innermost subspace at given |
| 258 | // offset(s) in outermost dimension(s) (len(offs) < NumDims). |
nothing calls this directly
no test coverage detected