Welcome to mirror list, hosted at ThFree Co, Russian Federation.

encoder_decoder.h « decoder « cpu « amun « src - github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54fee8177667922f7a75fd695c9fccbd7cde5072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once

#include <yaml-cpp/yaml.h>

#include "common/scorer.h"
#include "cpu/mblas/matrix.h"
#include "cpu/decoder/encoder_decoder_state.h"

namespace amunmt {
namespace CPU {

class CPUEncoderDecoderBase : public Scorer {
  private:
    using EDState = EncoderDecoderState;

  public:
    CPUEncoderDecoderBase(
    	const God &god,
        const std::string& name,
        const YAML::Node& config,
        unsigned tab);

    virtual State* NewState() const;

    virtual void GetAttention(mblas::Tensor& Attention) = 0;
    virtual mblas::Tensor& GetAttention() = 0;

    virtual void *GetNBest()
    {
      assert(false);
      return nullptr;
    }

    virtual const BaseTensor *GetBias() const
    {
      assert(false);
      return nullptr;
    }

  protected:
    mblas::Tensor SourceContext_;
};


}
}