StateNameModule.hpp 699 Bytes
Newer Older
Franck Dary's avatar
Franck Dary committed
1
2
3
4
5
6
7
8
#ifndef STATENAMEMODULE__H
#define STATENAMEMODULE__H

#include <torch/torch.h>
#include "Submodule.hpp"
#include "MyModule.hpp"
#include "LSTM.hpp"
#include "GRU.hpp"
9
#include "WordEmbeddings.hpp"
Franck Dary's avatar
Franck Dary committed
10
11
12
13
14

class StateNameModuleImpl : public Submodule
{
  private :

15
  WordEmbeddings embeddings{nullptr};
Franck Dary's avatar
Franck Dary committed
16
17
18
19
  int outSize;

  public :

Franck Dary's avatar
Franck Dary committed
20
  StateNameModuleImpl(std::string name, const std::string & definition);
Franck Dary's avatar
Franck Dary committed
21
22
23
  torch::Tensor forward(torch::Tensor input);
  std::size_t getOutputSize() override;
  std::size_t getInputSize() override;
Franck Dary's avatar
Franck Dary committed
24
  void addToContext(std::vector<std::vector<long>> & context, const Config & config) override;
25
  void registerEmbeddings() override;
Franck Dary's avatar
Franck Dary committed
26
27
28
29
30
};
TORCH_MODULE(StateNameModule);

#endif