tenferro_internal_frontend_core/scalar_value.rs
1use num_complex::{Complex32, Complex64};
2
3/// Dynamic scalar value extracted from a rank-0 dynamic tensor.
4///
5/// This preserves the original dtype and never performs implicit casting.
6///
7/// # Examples
8///
9/// ```rust
10/// use tenferro_internal_frontend_core::ScalarValue;
11///
12/// assert_eq!(ScalarValue::F64(2.0), ScalarValue::F64(2.0));
13/// ```
14#[derive(Debug, Clone, Copy, PartialEq)]
15pub enum ScalarValue {
16 F32(f32),
17 F64(f64),
18 C32(Complex32),
19 C64(Complex64),
20}