Skip to content
Snippets Groups Projects

[Fix] Producer clone and Tensor copy

Merged Maxence Naud requested to merge fix_207-producer-clone into dev
1 file
+ 13
0
Compare changes
  • Side-by-side
  • Inline
@@ -20,6 +20,7 @@
#include "aidge/data/half.hpp"
#include "aidge/utils/Attributes.hpp"
#include "aidge/utils/ErrorHandling.hpp"
namespace Aidge {
enum class DataType {
@@ -91,7 +92,19 @@ DataFormatTranspose getDataFormatTranspose(const DataFormat& src, const DataForm
class Data {
public:
Data() = delete;
Data(Data&& other) = default;
Data(const Data& other) = default;
Data(const std::string& type): mType(type) {};
Data& operator=(const Data& other) {
AIDGE_ASSERT(other.mType == mType, "Cannot copy a different type fo Data object.");
return *this;
};
Data& operator=(Data&& other) {
AIDGE_ASSERT(other.mType == mType, "Cannot copy a different type fo Data object.");
return *this;
};
constexpr const std::string& type() const {
return mType;
}
Loading