ztcl::tensor rows
Copies a range of rows of the first axis.
ztcl::tensor rows TENSOR FIRST LAST
Description
Gives a copy of the rows FIRST to LAST of the first axis, with both ends in the range.
Returns
A tensor.
Examples
Each example of this page runs after package require ztcl::tensor.
% set a [ztcl::tensor of {{1 2 3} {4 5 6}}]; ztcl::tensor rows $a 1 1
tensor f32 {1 3} {4.0 5.0 6.0}
Errors
% set a [ztcl::tensor of {{1 2 3} {4 5 6}}]; ztcl::tensor rows $a 1 2
tensor rows: 1..2 is outside 0..1
-errorcode ZTCL TENSOR
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.4
- Compute cost
- A cost for each element operation by its kind (a copy, an add, a division, a math function, a multiply-add of a matmul), set so that one compute unit takes about the time of one unit of plain Tcl. docs/modules/tensor.md has the table.