Skip to content
Snippets Groups Projects

[Add] broadcasting for Arithmetic Operators

Merged Houssem ROUIS requested to merge hrouis/aidge_core:broadcasting into dev
1 unresolved thread
16 files
+ 227
196
Compare changes
  • Side-by-side
  • Inline
Files
16
/********************************************************************************
* Copyright (c) 2024 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#ifndef AIDGE_CORE_OPERATOR_ARITHMETICOPERATOR_H_
#define AIDGE_CORE_OPERATOR_ARITHMETICOPERATOR_H_
#include <memory>
#include <string>
#include <vector>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/utils/Types.h"
#include "aidge/graph/Node.hpp"
namespace Aidge {
class ArithmeticOperator : public OperatorTensor {
public:
ArithmeticOperator() = delete;
ArithmeticOperator(const std::string& type)
: OperatorTensor(type, 2, 0, 1) {
}
ArithmeticOperator(const ArithmeticOperator& other) : OperatorTensor(other){ }
~ArithmeticOperator();
std::shared_ptr<Operator> clone() const override {
return std::make_shared<ArithmeticOperator>(*this);
}
void setBackend(const std::string & /*name*/, DeviceIdx_t /*device*/ = 0) override { printf("setBackend: not available yet.\n"); }
public:
void computeOutputDims() override final;
static const std::vector<std::string> getInputsName(){
return {"data_input_1", "data_input_2"};
}
static const std::vector<std::string> getOutputsName(){
return {"data_output"};
}
};
} // namespace Aidge
#endif // AIDGE_CORE_OPERATOR_ARITHMETICOPERATOR_H_
\ No newline at end of file
Loading