Skip to content

Commit e7d048b

Browse files
sebpuetzDaniël de Kok
authored andcommitted
Add derives to Embeddings and VocabWrap.
Derive Eq+PartialEq for VocabWrap and Clone for Embeddings.
1 parent 6957d1a commit e7d048b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/chunks/vocab/wrappers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::io::{Error, ErrorKind, Result};
1919
/// all the vocabularies and storage types known to this crate such
2020
/// that the type `Embeddings<VocabWrap, StorageWrap>` covers all
2121
/// variations.
22-
#[derive(Clone, Debug)]
22+
#[derive(Clone, Debug, Eq, PartialEq)]
2323
pub enum VocabWrap {
2424
SimpleVocab(SimpleVocab),
2525
ExplicitSubwordVocab(ExplicitSubwordVocab),

src/embeddings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::util::l2_normalize;
3030
/// This data structure stores word embeddings (also known as *word vectors*)
3131
/// and provides some useful methods on the embeddings, such as similarity
3232
/// and analogy queries.
33-
#[derive(Debug)]
33+
#[derive(Clone, Debug)]
3434
pub struct Embeddings<V, S> {
3535
metadata: Option<Metadata>,
3636
storage: S,

0 commit comments

Comments
 (0)