def read_flat

bendtorch-core@0.1.0.0 · src/tensor/signed.bend:272

import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core

272# The element at a signed flat index, PyTorch's A.flatten()[index], wrapped
273# among the element count; and the write at it.
274def read_flat(+shape: Shape.Shape, tensor: Core.Tensor<shape>, index: Position) ->
275  Core.Tensor<shape> & Result<&2, &2, Core.Error, F32>:
276  Core.read_flat(shape, tensor, wrap(Shape.count(shape), index))

Uses (10)

Used by (2)