///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
-#include "../C/mutable_data.h"
#include "primitive.hpp"
#include "memory.hpp"
#include <vector>
/// @details This primitive allows to pass data which can be written to during training.
/// For example, weights and biases for scoring networks.
/// This primitive can be also set as other primitive's output. In this case the underlying buffer will be the same in mutable_data and preceding primitive.
-struct mutable_data : public primitive_base<mutable_data, CLDNN_PRIMITIVE_DESC(mutable_data)> {
+struct mutable_data : public primitive_base<mutable_data> {
CLDNN_DECLARE_PRIMITIVE(mutable_data)
/// @brief Enum type to specify function for data filling.
filler_type fill_type = filler_type::no_fill)
: primitive_base(id, {input}, padding()), mem(mem), fill_type(fill_type) {}
- /// @brief Constructs a copy from C API @CLDNN_PRIMITIVE_DESC{mutable_data}
- explicit mutable_data(const dto* dto)
- : primitive_base(dto), mem(dto->mem), fill_type(static_cast<filler_type>(dto->fill_type)) {
- mem.retain();
- }
-
/// @brief @ref memory object which contains data.
/// @note If memory is attached by memory::attach(), the attached buffer should be valid till network build.
memory mem;
/// @brief Specifies function which will be used to fill weights.
filler_type fill_type;
-
-protected:
- void update_dto(dto& dto) const override {
- dto.mem = mem.get();
- dto.fill_type = static_cast<cldnn_filler_type>(fill_type);
- }
};
/// @}
/// @}