CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
(frm Tensor)
| 264 | // optimized implementation if the other tensor is of the same type, and |
| 265 | // otherwise it goes through appropriate standard type. |
| 266 | func (tsr *Bits) CopyFrom(frm Tensor) { |
| 267 | if fsm, ok := frm.(*Bits); ok { |
| 268 | copy(tsr.Values, fsm.Values) |
| 269 | return |
| 270 | } |
| 271 | sz := min(len(tsr.Values), frm.Len()) |
| 272 | for i := 0; i < sz; i++ { |
| 273 | tsr.Values.Set(i, Float64ToBool(frm.Float1D(i))) |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | // CopyShapeFrom copies just the shape from given source tensor |
| 278 | // calling SetShape with the shape params from source (see for more docs). |
nothing calls this directly
no test coverage detected