Переглянути джерело

added getVectorDimensions function

Summary:
added getVectorDimensions() function in order to access dimensions of the vector loaded by model
Depends on D5227866

Reviewed By: EdouardGrave

Differential Revision: D5228510

fbshipit-source-id: a0ed799a639a723f3f814d5c2a9d7b40f7f09064
Necati Bora Edizel 8 роки тому
батько
коміт
3346ac9cce
2 змінених файлів з 5 додано та 0 видалено
  1. 4 0
      src/fasttext.cc
  2. 1 0
      src/fasttext.h

+ 4 - 0
src/fasttext.cc

@@ -641,4 +641,8 @@ void FastText::train(std::shared_ptr<Args> args) {
   }
 }
 
+int FastText::getDimension() const {
+    return args_->dim;
+}
+
 }

+ 1 - 0
src/fasttext.h

@@ -88,6 +88,7 @@ class FastText {
     void train(std::shared_ptr<Args>);
 
     void loadVectors(std::string);
+    int getDimension() const;
 };
 
 }