mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-12-24 07:14:22 +00:00
Migrate input layer
This commit is contained in:
37
src/layers/input.cpp
Normal file
37
src/layers/input.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include "input.hpp"
|
||||
|
||||
using namespace CUDANet::Layers;
|
||||
|
||||
Input::Input(int inputSize) : inputSize(inputSize) {
|
||||
#ifdef USE_CUDA
|
||||
initCUDA();
|
||||
#endif
|
||||
}
|
||||
|
||||
Input::~Input() {
|
||||
#ifdef USE_CUDA
|
||||
delCUDA();
|
||||
#endif
|
||||
}
|
||||
|
||||
float* Input::forwardCPU(const float* input) {
|
||||
throw std::logic_error("Not implemented");
|
||||
}
|
||||
|
||||
float* Input::forward(const float* input) {
|
||||
#ifdef USE_CUDA
|
||||
return forwardCUDA(input);
|
||||
#else
|
||||
return forwardCPU(input);
|
||||
#endif
|
||||
}
|
||||
|
||||
int Input::getOutputSize() {
|
||||
return inputSize;
|
||||
}
|
||||
|
||||
int Input::getInputSize() {
|
||||
return inputSize;
|
||||
}
|
||||
Reference in New Issue
Block a user