Skip to content
Snippets Groups Projects

Scheduler ConnectInput and tensor filling with offset tests

Merged Thibault Allenet requested to merge dataloader into dev
Files
3
@@ -33,7 +33,7 @@ private:
@@ -33,7 +33,7 @@ private:
public:
public:
static constexpr const char *Backend = "cpu";
static constexpr const char *Backend = "cpu";
TensorImpl_cpu(DeviceIdx_t device, NbElts_t length) : TensorImpl(Backend, device, length) {}
TensorImpl_cpu(DeviceIdx_t device, std::vector<DimSize_t> dims) : TensorImpl(Backend, device, dims) {}
bool operator==(const TensorImpl &otherImpl) const override final {
bool operator==(const TensorImpl &otherImpl) const override final {
const auto& typedOtherImpl = reinterpret_cast<const TensorImpl_cpu<T> &>(otherImpl);
const auto& typedOtherImpl = reinterpret_cast<const TensorImpl_cpu<T> &>(otherImpl);
@@ -47,8 +47,8 @@ public:
@@ -47,8 +47,8 @@ public:
return i == mNbElts;
return i == mNbElts;
}
}
static std::shared_ptr<TensorImpl_cpu> create(DeviceIdx_t device, NbElts_t length) {
static std::shared_ptr<TensorImpl_cpu> create(DeviceIdx_t device, std::vector<DimSize_t> dims) {
return std::make_shared<TensorImpl_cpu<T>>(device, length);
return std::make_shared<TensorImpl_cpu<T>>(device, dims);
}
}
inline std::size_t scalarSize() const noexcept override final { return sizeof(T); }
inline std::size_t scalarSize() const noexcept override final { return sizeof(T); }
@@ -175,7 +175,6 @@ private:
@@ -175,7 +175,6 @@ private:
}
}
}
}
};
};
namespace {
namespace {
static Registrar<Tensor> registrarTensorImpl_cpu_Float64(
static Registrar<Tensor> registrarTensorImpl_cpu_Float64(
{"cpu", DataType::Float64}, Aidge::TensorImpl_cpu<double>::create);
{"cpu", DataType::Float64}, Aidge::TensorImpl_cpu<double>::create);
@@ -183,10 +182,18 @@ static Registrar<Tensor> registrarTensorImpl_cpu_Float32(
@@ -183,10 +182,18 @@ static Registrar<Tensor> registrarTensorImpl_cpu_Float32(
{"cpu", DataType::Float32}, Aidge::TensorImpl_cpu<float>::create);
{"cpu", DataType::Float32}, Aidge::TensorImpl_cpu<float>::create);
static Registrar<Tensor> registrarTensorImpl_cpu_Float16(
static Registrar<Tensor> registrarTensorImpl_cpu_Float16(
{"cpu", DataType::Float16}, Aidge::TensorImpl_cpu<half_float::half>::create);
{"cpu", DataType::Float16}, Aidge::TensorImpl_cpu<half_float::half>::create);
static Registrar<Tensor> registrarTensorImpl_cpu_Int32(
{"cpu", DataType::Int32}, Aidge::TensorImpl_cpu<int>::create);
static Registrar<Tensor> registrarTensorImpl_cpu_Int64(
static Registrar<Tensor> registrarTensorImpl_cpu_Int64(
{"cpu", DataType::Int64}, Aidge::TensorImpl_cpu<long>::create);
{"cpu", DataType::Int64}, Aidge::TensorImpl_cpu<long>::create);
 
static Registrar<Tensor> registrarTensorImpl_cpu_Int32(
 
{"cpu", DataType::Int32}, Aidge::TensorImpl_cpu<int>::create);
 
static Registrar<Tensor> registrarTensorImpl_cpu_Int16(
 
{"cpu", DataType::Int16}, Aidge::TensorImpl_cpu<int16_t>::create);
 
static Registrar<Tensor> registrarTensorImpl_cpu_UInt16(
 
{"cpu", DataType::UInt16}, Aidge::TensorImpl_cpu<uint16_t>::create);
 
static Registrar<Tensor> registrarTensorImpl_cpu_Int8(
 
{"cpu", DataType::Int8}, Aidge::TensorImpl_cpu<int8_t>::create);
 
static Registrar<Tensor> registrarTensorImpl_cpu_UInt8(
 
{"cpu", DataType::UInt8}, Aidge::TensorImpl_cpu<uint8_t>::create);
} // namespace
} // namespace
} // namespace Aidge
} // namespace Aidge
Loading