class BiasAddOp : public OpDescription
{
public:
- explicit BiasAddOp(const ADT::TensorVariant &weights) : OpDescription(1, 1), _weights(weights) {}
+ explicit BiasAddOp(const TensorVariant &weights) : OpDescription(1, 1), _weights(weights) {}
- const ADT::TensorVariant &getWeights() const { return _weights; }
+ const TensorVariant &getWeights() const { return _weights; }
private:
- ADT::TensorVariant _weights;
+ TensorVariant _weights;
};
} // namespace ops
class Conv2DOp : public OpDescription
{
public:
- Conv2DOp(const ADT::TensorVariant &kernel, const Shape &strides, PaddingType padding)
+ Conv2DOp(const TensorVariant &kernel, const Shape &strides, PaddingType padding)
: OpDescription(1, 1), _kernel(kernel), _strides(strides),
_padding(padding)
{
_pads.resize(3);
}
- const ADT::TensorVariant &getKernel() const { return _kernel; }
+ const TensorVariant &getKernel() const { return _kernel; }
const Shape &getStrides() const { return _strides; }
void setPadding(int dim, int pad) { _pads[dim] = pad; }
private:
- const ADT::TensorVariant _kernel;
+ const TensorVariant _kernel;
Shape _strides;
PaddingType _padding;
std::vector<int> _pads;
class DepthwiseConv2DOp : public OpDescription
{
public:
- explicit DepthwiseConv2DOp(const ADT::TensorVariant &kernel, const Shape &strides, PaddingType padding)
+ explicit DepthwiseConv2DOp(const TensorVariant &kernel, const Shape &strides, PaddingType padding)
: OpDescription(1, 1), _kernel(kernel), _strides(strides), _padding(padding)
{
_pads.resize(_kernel.getShape().rank());
}
- const ADT::TensorVariant &getKernel() const { return _kernel; }
+ const TensorVariant &getKernel() const { return _kernel; }
const Shape &getStrides() const { return _strides; }
void setPadding(int dim, int pad) { _pads[dim] = pad; }
private:
- const ADT::TensorVariant _kernel;
+ const TensorVariant _kernel;
Shape _strides;
PaddingType _padding;
std::vector<int> _pads;
namespace ops
{
+using namespace nncc::contrib::core;
+
class FullyConnectedOp : public OpDescription
{
public:
- explicit FullyConnectedOp(const ADT::TensorVariant &weights) : OpDescription(1, 1), _weights(weights) {}
+ explicit FullyConnectedOp(const TensorVariant &weights) : OpDescription(1, 1), _weights(weights) {}
- const ADT::TensorVariant &getWeights() const { return _weights; }
+ const TensorVariant &getWeights() const { return _weights; }
private:
- ADT::TensorVariant _weights;
+ TensorVariant _weights;
};
} // namespace ops
#include <string>
#include <map>
+#include <nnc/core/linalg/TensorVariant.h>
#include "nncc/core/ADT/tensor/Shape.h"
namespace model
{
+using nncc::contrib::core::ADT::TensorVariant;
+
class OpDescription {
public:
explicit OpDescription(const size_t max_inputs, const size_t max_outputs);