-
Notifications
You must be signed in to change notification settings - Fork 0
Description
According to the specification section 3:
Slice indexing: any index position inside
[...]may be a range of the formlo-hiwhereloandhiare ordinary index expressions. A range selects the contiguous inclusive span of positions fromlotohi(both endpoints follow the same one-based and negative-index rules described above). Slices may be mixed with hard indices (for example,tensor[lo-hi, i]) and reduce the dimensionality of the selected result according to which positions are fixed versus sliced: selecting one or more ranges produces aTNSvalue whose shape equals the lengths of the specified ranges (in the same order). Assigning to a slice is supported: the left-hand side may use ranges in its indices, and the right-hand-side expression must evaluate to aTNSwhose shape exactly matches the selected slice. Elementwise type compatibility is required: each element being written must match the static element type of the target position, otherwise a runtime error is raised. Example:tensor[10-11] = [1,11]writes a two-element tensor into the slice consisting of positions10and11.
In the implementation, however, assignment to a range is forbidden.