pub struct StructuredEncoding;
impl StructuredEncoding {
pub const TABULAR_BINARY: &'static str = "binary";
pub const NUMPY: &'static str = "numpy";
pub const MATLAB: &'static str = "matlab";
pub const MATRIX_MARKET: &'static str = "matrix-market";
pub const ONNX: &'static str = "onnx";
}
pub struct CsvEncodingLabel;
impl CsvEncodingLabel {
pub const UTF8: &'static str = "UTF-8";
pub const NON_UTF8: &'static str = "Non-UTF-8";
}
pub struct ArrowIpcContainerKind;
impl ArrowIpcContainerKind {
pub const IPC_FILE: &'static str = "ipc_file";
pub const IPC_STREAM: &'static str = "ipc_stream";
pub const FEATHER: &'static str = "feather";
}
pub struct MtxSymmetryLabel;
impl MtxSymmetryLabel {
pub const GENERAL: &'static str = "general";
pub const SYMMETRIC: &'static str = "symmetric";
}
pub mod limits {
pub const TABULAR_COL_SCALE_NUMERATOR: usize = 4000;
pub const TABULAR_COLUMN_CHUNK: usize = 256;
pub const TABULAR_SAMPLE_BYTE_THRESHOLD: u64 = 100_000;
pub const TABULAR_BYTE_SCALE_MIN_RETAIN_FRAC: f64 = 0.03;
pub const TABULAR_BYTE_SCALE_PCT_PER_DECADE: f64 = 0.02;
pub const TABULAR_BPR_SKINNY_MAX_BYTES: u64 = 2048;
pub const TABULAR_FULL_SCAN_MAX_FILE_BYTES: u64 = 64 * 1024 * 1024;
pub const TABULAR_FULL_SCAN_MAX_ROWS: usize = 500_000;
pub const CSV_SAMPLE_BYTE_THRESHOLD: u64 = TABULAR_SAMPLE_BYTE_THRESHOLD;
pub const CSV_BYTE_SCALE_MIN_RETAIN_FRAC: f64 = TABULAR_BYTE_SCALE_MIN_RETAIN_FRAC;
pub const CSV_BYTE_SCALE_PCT_PER_DECADE: f64 = TABULAR_BYTE_SCALE_PCT_PER_DECADE;
pub const MAX_MTX_INFERENCE_STRING_CELLS: usize = 256_000;
pub const MAX_MTX_TABULAR_CELLS: usize = 8_000_000;
pub const TENSOR3D_MAX_PLANES: usize = 32;
pub const TENSOR3D_MAX_REPORTED_PLANES_LOG_CAP: usize = 64;
pub const TENSOR3D_MAX_LINEAR_SAMPLES: usize = 2_000_000;
pub const TENSOR3D_MAX_PLANE_LINEAR_SAMPLES: usize = 200_000;
}
#[must_use]
pub fn tensor3d_max_reported_planes(n_along: usize) -> usize {
if n_along == 0 {
return 0;
}
let d = n_along.ilog10().saturating_sub(3);
(limits::TENSOR3D_MAX_PLANES + d as usize * 3).min(limits::TENSOR3D_MAX_REPORTED_PLANES_LOG_CAP)
}