law signed_narrow_first
import bendtorch-core@0.1.0.0/src/tensor/signed_LAWS.bend as SignedLAWSimport Base
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed
import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
371# A signed narrow takes a start in -extent..extent, PyTorch's range. A start
372# counted from the start is the unsigned narrow's, which refuses one past
373# the extent itself; Last{k} below the extent is wrapped among it ...
374law signed_narrow_first:
375 for input: Core.Dynamic
376 for +dim: Signed.Position
377 for +k: U32
378 for +length: U32
379 {Signed.narrow(input, dim, Signed.First{k}, length) == Slice.narrow(input, axis_of(input, dim), k, length) :
380 Core.Dynamic & Result<&2, &1, Slice.Error, Core.Dynamic>}
Uses (9)
Used by (0)
No other definition uses this definition.