vortex_tensor/scalar_fns/
mod.rs1use std::fmt;
7
8pub mod cosine_similarity;
9pub mod inner_product;
10pub mod l2_denorm;
11pub mod l2_norm;
12
13#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)]
15pub enum ApproxOptions {
16 #[default]
18 Exact,
19 Approximate,
21}
22
23impl ApproxOptions {
24 pub fn is_exact(&self) -> bool {
26 matches!(self, Self::Exact)
27 }
28
29 pub fn is_approx(&self) -> bool {
31 matches!(self, Self::Approximate)
32 }
33}
34
35impl fmt::Display for ApproxOptions {
36 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37 match self {
38 Self::Exact => write!(f, "Exact"),
39 Self::Approximate => write!(f, "Approximate"),
40 }
41 }
42}