From e3ce4dd2056c53287f261190b9fe2856822b2ada Mon Sep 17 00:00:00 2001 From: ggaspersic Date: Wed, 9 Aug 2023 15:06:54 +0200 Subject: [PATCH] Uneeded consts file removed --- src/consts.rs | 4 ---- src/lib.rs | 1 - src/main.rs | 1 - src/model_instance.rs | 8 +++++--- 4 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 src/consts.rs diff --git a/src/consts.rs b/src/consts.rs deleted file mode 100644 index 279c8f6c..00000000 --- a/src/consts.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Maximum supported FFM embedding size -pub const FFM_MAX_K: usize = 128; - -pub const NUM_TAPES: usize = 8; diff --git a/src/lib.rs b/src/lib.rs index be123590..cae377e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,6 @@ mod block_normalize; mod block_relu; mod cache; mod cmdline; -mod consts; mod feature_buffer; mod feature_transform_executor; mod feature_transform_implementations; diff --git a/src/main.rs b/src/main.rs index 86aeb855..f5b2049a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,6 @@ mod block_normalize; mod block_relu; mod cache; mod cmdline; -mod consts; mod feature_buffer; mod feature_transform_executor; mod feature_transform_implementations; diff --git a/src/model_instance.rs b/src/model_instance.rs index 86360dc2..4e71f014 100644 --- a/src/model_instance.rs +++ b/src/model_instance.rs @@ -5,7 +5,6 @@ use std::io::ErrorKind; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use crate::consts; use crate::feature_transform_parser; use crate::vwmap; use crate::vwmap::NamespaceDescriptor; @@ -13,6 +12,9 @@ use crate::vwmap::NamespaceDescriptor; const WEIGHT_DELIM: &str = ":"; const VERBOSE_FIELD_DELIM: &str = ","; +// Maximum supported FFM embedding size +const FFM_MAX_K: usize = 128; + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct FeatureComboDesc { pub namespace_descriptors: Vec, @@ -364,12 +366,12 @@ impl ModelInstance { if let Some(val) = cl.value_of("ffm_k") { mi.ffm_k = val.parse()?; - if mi.ffm_k > consts::FFM_MAX_K as u32 { + if mi.ffm_k > FFM_MAX_K as u32 { return Err(Box::new(IOError::new( ErrorKind::Other, format!( "Maximum ffm_k is: {}, passed: {}", - consts::FFM_MAX_K, + FFM_MAX_K, mi.ffm_k ), )));