def fitted

bendtorch-core@0.1.0.0 · src/autograd/broadcast.bend:35

import bendtorch-core@0.1.0.0/src/autograd/broadcast.bend as Broadcast
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

35def fitted(input: Core.Dynamic, +target: Shape.Shape, +plan: Shape.BroadcastPlan, same: Bool) ->
36  Core.Dynamic & Result<&2, &1, Error, Core.Dynamic>:
37  match same:
38    case False{}:
39      (input, Fail{NotBroadcastable{}})
40    case True{}:
41      zeroed(input, target, plan, Core.new(target, 0.0))

Uses (10)

Used by (6)