pub trait TypedTensorMaskOpsExt {
// Required method
fn where_select<T: TensorScalar, B: TensorBackend>(
&self,
on_true: &TypedTensor<T>,
on_false: &TypedTensor<T>,
backend: &mut B,
) -> Result<TypedTensor<T>>;
}Expand description
Backend-explicit bool-mask operations for typed tensors.
§Public API rationale
This trait keeps where_select available as a method on bool
TypedTensors while preserving the crate-root extension-trait surface. It
is public because downstream users call it directly; the implementation
helper in the private typed_tensor module is not a compatibility API.
Required Methods§
Sourcefn where_select<T: TensorScalar, B: TensorBackend>(
&self,
on_true: &TypedTensor<T>,
on_false: &TypedTensor<T>,
backend: &mut B,
) -> Result<TypedTensor<T>>
fn where_select<T: TensorScalar, B: TensorBackend>( &self, on_true: &TypedTensor<T>, on_false: &TypedTensor<T>, backend: &mut B, ) -> Result<TypedTensor<T>>
Select typed values using this bool tensor as condition.
§Errors
Returns tenferro_tensor::Error::Validation with
ShapeMismatch::IncompatibleShapes when the condition or either branch
cannot broadcast to the other operands, or
tenferro_tensor::Error::BackendSource for a typed backend failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.