pub struct BertVocab {
pub values: BTreeMap<String, i64>,
pub indices: BTreeMap<i64, String>,
pub special_value_indices: BTreeMap<String, i64>,
pub special_indices: BTreeMap<i64, String>,
}
pub struct BaseTokenizer<T: Vocab> {
vocab: T,
lower_case: bool,
strip_accents: bool,
}
pub struct BertTokenizer {
vocab: BertVocab,
base_tokenizer: BaseTokenizer<BertVocab>,
}
impl Transform<(Tensor<u8>, Tensor<u8>)> for Tokenizers {
type Output<'a> = (Tensor<i32>, Tensor<i32>, Tensor<i32>, Tensor<&'a str>);
fn transform (&mut self, s: (Tensor<u8>, Tensor<u8>)) -> (Tensor<i32>, Tensor<i32>, Tensor<i32>, Tensor<&str>) {
todo!
}
I'm getting this error:
error[E0658]: generic associated types are unstable
--> src/lib.rs:45:5
|
45 | type Output<'a> = (Tensor<i32>, Tensor<i32>, Tensor<i32>, Tensor<&'a str>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
error[E0195]: lifetime parameters or bounds on type `Output` do not match the trait declaration
--> src/lib.rs:45:16
|
45 | type Output<'a> = (Tensor<i32>, Tensor<i32>, Tensor<i32>, Tensor<&'a str>);
| ^^^^ lifetimes do not match type in trait
Some errors have detailed explanations: E0195, E0658.
For more information about an error, try `rustc --explain E0195`.
Trait Definition:
I'm new to Rust and trying to understand lifetimes. Could someone please help me understand why I'm getting this error? How can I fix this? I'm not sure if this much data is sufficient to understand the error, please let me know if anything else is needed from my side.