TensorFloat1D returns the float value of a Tensor cell's cell at given 1D offset within cell, for given column (by name), row index for columns that have higher-dimensional tensors so each row is represented by an n-1 dimensional tensor, with the outer dimension being the row number. Returns 0 on a
(column string, row int, idx int)
| 544 | // being the row number. Returns 0 on any error -- see Try version for |
| 545 | // error returns. |
| 546 | func (dt *Table) TensorFloat1D(column string, row int, idx int) float64 { |
| 547 | if !dt.IsValidRow(row) { |
| 548 | return 0 |
| 549 | } |
| 550 | ct := dt.ColumnByName(column) |
| 551 | if ct == nil { |
| 552 | return 0 |
| 553 | } |
| 554 | if ct.NumDims() == 1 { |
| 555 | return 0 |
| 556 | } |
| 557 | _, sz := ct.RowCellSize() |
| 558 | if idx >= sz || idx < 0 { |
| 559 | return 0 |
| 560 | } |
| 561 | off := row*sz + idx |
| 562 | return ct.Float1D(off) |
| 563 | } |
| 564 | |
| 565 | ///////////////////////////////////////////////////////////////////////////////////// |
| 566 | // Set |
nothing calls this directly
no test coverage detected