def shapes

stelliferous@0.0.2.0 · tensor_select.bend:74

import stelliferous@0.0.2.0/tensor_select.bend as TensorSelect
import Base
import stelliferous@0.0.2.0/tensor.bend as Tensors
import stelliferous@0.0.2.0/tensor_shape.bend as Shapes

74def shapes(same: Bool,+shape: List<&2,U32>,count: Maybe<&2,U32>,mask_shape: List<&2,U32>,yes_shape: List<&2,U32>,no_shape: List<&2,U32>,fill: F32,workers: U32,
75  mask: Tensors.Tensor<F32>,yes: Tensors.Tensor<F32>,no: Tensors.Tensor<F32>) -> Tensors.Tensor<F32>:
76  match same count:
77    case True{} Some{count}: matching(shape,count,fill,workers,mask,yes,no)
78    case False{} Some{count}:
79      dense(shape,count,workers,expanded(Shapes.same_extents(mask_shape,shape),shape,mask),
80        expanded(Shapes.same_extents(yes_shape,shape),shape,yes),expanded(Shapes.same_extents(no_shape,shape),shape,no))
81    case same None{}: Tensors.failed(~F32,"select",Tensors.InvalidShape{shape},shape,fill,workers)

Uses (12)

Used by (1)