Class EncoderDecoderLayerBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class EncoderDecoderLayerBase : public marian::LayerBase

Base class for Encoder and Decoder classes.

Have embeddings and a batch index (=stream index).

Subclassed by marian::DecoderBase, marian::EncoderBase

Public Functions

Ptr<IEmbeddingLayer> getEmbeddingLayer(bool ulr = false) const

Get all embedding layer(s).

It lazily creates the embedding layer on first call. This is lazy mostly because the constructors of the consuming objects are not guaranteed presently to have access to their graph.


a shared pointer to the embedding layer


Protected Functions

EncoderDecoderLayerBase(Ptr<ExpressionGraph> graph, Ptr<Options> options, const std::string &prefix, size_t batchIndex, float dropoutEmbeddings, bool embeddingFix)
virtual ~EncoderDecoderLayerBase()

Protected Attributes

const std::string prefix_
const bool embeddingFix_
const float dropoutEmbeddings_
const bool inference_
const size_t batchIndex_
std::vector<Ptr<IEmbeddingLayer>> embeddingLayers_