def scalar_at

bendtorch-core@0.1.0.0 · src/tensor/relu_LAWS.bend:34

import bendtorch-core@0.1.0.0/src/tensor/relu_LAWS.bend as ReluLAWS
import Base
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise

34# The output words of `operation` with each word as the left operand and
35# `right` as the right one.
36def scalar_at(+operation: Elementwise.Operation, +right: U32, words: List<&2, U32>) -> List<&2, U32>:
37  match words:
38    case Nil{}:
39      Nil{}
40    case Con{word, rest}:
41      Elementwise.bits(Elementwise.scalar(operation, from_bits(word), from_bits(right))) <> scalar_at(operation, right, rest)

Uses (6)

Used by (2)