def scatter

bendtorch-core@0.1.0.0 · src/tensor/slice.bend:383

import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
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

383# PyTorch's slice_backward: the gradient g of a planned slice's output,
384# scattered into +0.0 words of the input's shape. g must hold as many words
385# as the slice's output; g comes back unchanged next to the result.
386def scatter(g: Core.Dynamic, +input: Shape.Shape, +plan: Plan) -> Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
387  Core.Packed{+shape, tensor} = g
388  built(Backward{}, shape, input, plan, tensor, Core.new(input, 0.0))

Uses (9)

Used by (1)