Skip to content
Snippets Groups Projects
Commit 86952c94 authored by Maxence Naud's avatar Maxence Naud
Browse files

Fix EnumStrings<CastAttr> namespace

parent 029da77d
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!145Improve UI for Operator/Node/GraphView/Tensor
Pipeline #49193 failed
......@@ -79,7 +79,7 @@ constexpr std::array<DataFormatTranspose, 7> DataFormatTransposeDict = {{
* Get the DataFormatTranspose array to transpose data from src to dst DataFormat.
* @param src Source DataFormat
* @param dst Destinatin DataFormat
* @return DataFormatTranspose Permutation array to achieve a transposition
* @return DataFormatTranspose Permutation array to achieve a transposition
* from src to dst DataFormat.
*/
constexpr inline DataFormatTranspose getDataFormatTranspose(const DataFormat& src, const DataFormat& dst) {
......
......@@ -19,7 +19,6 @@
#include "aidge/utils/Registrar.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/graph/Node.hpp"
#include "aidge/utils/StaticAttributes.hpp"
#include "aidge/utils/Types.h"
......@@ -47,14 +46,7 @@ private:
public:
Cast_Op() = delete;
Cast_Op(const DataType targetType)
: OperatorTensor(Type, 1, 0, 1),
mAttributes(std::make_shared<Attributes_>(
attr<CastAttr::TargetType>(targetType)))
{
mImpl = std::make_shared<Cast_OpImpl>(*this);
mOutputs[0]->setDataType(targetType);
}
Cast_Op(const DataType targetType);
/**
* @brief Copy-constructor. Copy the operator attributes and its output tensor(s), but not its input tensors (the new operator has no input associated).
......@@ -97,12 +89,11 @@ public:
inline std::shared_ptr<Node> Cast(const DataType targetType, const std::string& name = "") {
return std::make_shared<Node>(std::make_shared<Cast_Op>(targetType), name);
}
} // namespace Aidge
namespace {
template <>
const char* const EnumStrings<Aidge::CastAttr>::data[] = { "TargetType" };
}
} // namespace Aidge
#endif /* AIDGE_CORE_OPERATOR_CAST_H_ */
\ No newline at end of file
#endif /* AIDGE_CORE_OPERATOR_CAST_H_ */
......@@ -27,6 +27,16 @@ void Aidge::Cast_OpImpl::forward() {
const std::string Aidge::Cast_Op::Type = "Cast";
Aidge::Cast_Op::Cast_Op(const DataType targetType)
: OperatorTensor(Type, 1, 0, 1),
mAttributes(std::make_shared<Attributes_>(
attr<CastAttr::TargetType>(targetType)))
{
mImpl = std::make_shared<Cast_OpImpl>(*this);
mOutputs[0]->setDataType(targetType);
}
void Aidge::Cast_Op::setBackend(const std::string& name, Aidge::DeviceIdx_t device) {
if (Registrar<Cast_Op>::exists({name})) {
SET_IMPL_MACRO(Cast_Op, *this, name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment