def gradient_shaped

bendtorch-core@0.1.0.0 · src/tensor/batched_matmul.bend:376

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

376def gradient_shaped(+given: Layout, first: Core.Dynamic, second: Core.Dynamic, -dims: List<&2, U32>,
377  result: Shape.ConstructResult<dims>) -> Result<&2, &1, Core.Error, Core.Dynamic & Core.Dynamic & Core.Dynamic>:
378  match result:
379    case Shape.SError{error}:
380      Fail{Core.ShapeError{error}}
381    case Shape.SBuilt{+shape, preserved}:
382      product(given, shape, first, second)

Uses (9)

Used by (2)