use super::kernel::elementwise_binary;
use crate::backend_ops::{BinaryOp, ElementwiseOps};
use coeus_core::Scalar;
use coeus_tensor::Tensor;
#[inline]
pub fn eq<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Eq).expect("eq: incompatible shapes")
}
#[inline]
pub fn ne<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Ne).expect("ne: incompatible shapes")
}
#[inline]
pub fn lt<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Lt).expect("lt: incompatible shapes")
}
#[inline]
pub fn gt<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Gt).expect("gt: incompatible shapes")
}
#[inline]
pub fn le<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Le).expect("le: incompatible shapes")
}
#[inline]
pub fn ge<T: Scalar, B: ElementwiseOps<T>>(
a: &Tensor<T, B>,
b: &Tensor<T, B>,
backend: &B,
) -> Tensor<T, B> {
elementwise_binary(a, b, backend, BinaryOp::Ge).expect("ge: incompatible shapes")
}