Skip to main content

broadcast_runtime

Function broadcast_runtime 

Source
fn broadcast_runtime(
    left: &NativeNode,
    right: &NativeNode,
    matching: &BinaryMatching,
) -> Result<BroadcastRuntime>
Expand description

The broadcast a binary node with one scalar operand is, read off its binding.

One evaluated vector and one scalar is a broadcast over the vector, and two scalars of which one varies is a broadcast over the varying one. A constant comes from the scalar node’s own binding and ScalarOperand preserves its side; a varying scalar is read from the chunk its node hands over.

NativeNode::validate refuses a binary operand that produces neither evaluated values nor a scalar before any of this runs, so the last arm below is an exhaustiveness backstop.