text: // SPDX-License-Identifier: Apache-2.0
  /**
   * Copyright (C) 2021 Jijoong Moon <jijoong.moon@samsung.com>
   *
   * @file   embedding.h
   * @date   04 March 2021
   * @brief  This is Embedding Layer Class of Neural Network
   * @see    https://github.com/nnstreamer/nntrainer
   * @author Jijoong Moon <jijoong.moon@samsung.com>
   * @bug    No known bugs except for NYI items
   *
   */
  
  #ifndef __EMBEDDING_H__
  #define __EMBEDDING_H__
  #ifdef __cplusplus
  
  #include <common_properties.h>
  #include <layer_impl.h>
  
  namespace nntrainer {
  
  /**
   * @class   EmbeddingLayer
   * @brief   EmbeddingLayer
   * @todo    Support setBatch for EmbeddingLayer
   */
  class EmbeddingLayer : public LayerImpl {
  public:
    /**
     * @brief     Constructor of Embedding Layer
     */
    EmbeddingLayer();
  
    /**
     * @brief     Destructor of Embedding Layer
     */
    ~EmbeddingLayer() = default;
  
    /**
     *  @brief  Move constructor.
     *  @param[in] EmbeddingLayer &&
     */
    EmbeddingLayer(EmbeddingLayer &&rhs) noexcept = default;
  
    /**
     * @brief  Move assignment operator.
     * @parma[in] rhs EmbeddingLayer to be moved.
     */
    EmbeddingLayer &operator=(EmbeddingLayer &&rhs) = default;
  
    /**
     * @copydoc Layer::finalize(InitLayerContext &context)
     */
    void finalize(InitLayerContext &context) override;
  
    /**
     * @copydoc Layer::forwarding(RunLayerContext &context, bool training)
     */
    void forwarding(RunLayerContext &context, bool training) override;
  
    /**
     * @copydoc Layer::calcDerivative(RunLayerContext &context)
     */
    void calcDerivative(RunLayerContext &context) override;
  
    /**
     * @copydoc Layer::calcGradient(RunLayerContext &context)
     */
    void calcGradient(RunLayerContext &context) override;
  
    /**
     * @copydoc Layer::exportTo(Exporter &exporter, ExportMethods method)
     */
    void exportTo(Exporter &exporter, const ExportMethods &method) const override;
  
    /**
     * @copydoc Layer::getType()
     */
    const std::string getType() const override { return EmbeddingLayer::type; };
  
    /**
     * @copydoc Layer::supportBackwarding()
     */
    bool supportBackwarding() const override { return false; }
  
    using Layer::setProperty;
  
    /**
     * @copydoc Layer::setProperty(const PropertyType type, const std::string
     * &value)
     */
    void setProperty(const std::vector<std::string> &values) override;
  
    inline static const std::string type = "embedding";
  
  private:
    std::tuple<props::InDim, props::OutDim> embedding_props;
    unsigned int weight_idx;
  };
  } // namespace nntrainer
  
  #endif /* __cplusplus */
  #endif /* __EMBEDDING_H__ */
  