2 // Copyright (c) 2018 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
19 #include "primitive.hpp"
23 /// @addtogroup cpp_api C++ API
25 /// @addtogroup cpp_topology Network Topology
27 /// @addtogroup cpp_primitives Primitives
31 /// @details Performs embedding upon input.
33 /// @n input_size = { 8, 1, 1, 75 };
34 /// @n weights_size = {15, 1, 62, 1 };
35 /// @n output_size = { 8, 75, 15, 1 };
38 struct embed : public primitive_base<embed> {
39 CLDNN_DECLARE_PRIMITIVE(embed)
41 /// @brief Constructs embed primitive.
42 /// @param id This primitive id.
43 /// @param input Input primitive id.
44 /// @param weights Primitive id containing weights data.
45 /// @param bias Primitive id containing bias data.
47 const primitive_id& id,
48 const primitive_id& input,
49 const primitive_id& weights,
50 const primitive_id& bias)
51 : primitive_base(id, {input}), weights(weights), bias(bias) {}
53 /// @brief Constructs embed primitive.
54 /// @param id This primitive id.
55 /// @param input Input primitive id.
57 const primitive_id& id,
58 const primitive_id& input,
59 const primitive_id& weights)
60 : primitive_base(id, {input}), weights(weights), bias("") {}
62 /// @brief Primitive id containing weights data.
64 /// @brief Primitive id containing bias data.
68 std::vector<std::reference_wrapper<const primitive_id>> get_dependencies() const override {
72 return {weights, bias};