mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 09:44:28 +00:00
Implement getOutputSize and getInputSize for seq layers
This commit is contained in:
@@ -6,34 +6,48 @@
|
||||
namespace CUDANet::Layers {
|
||||
|
||||
class Output : public SequentialLayer {
|
||||
public:
|
||||
/**
|
||||
* @brief Create a new Output layer
|
||||
*
|
||||
* @param inputSize Size of the input vector
|
||||
*/
|
||||
explicit Output(int inputSize);
|
||||
public:
|
||||
/**
|
||||
* @brief Create a new Output layer
|
||||
*
|
||||
* @param inputSize Size of the input vector
|
||||
*/
|
||||
explicit Output(int inputSize);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Output layer
|
||||
*
|
||||
*/
|
||||
~Output();
|
||||
/**
|
||||
* @brief Destroy the Output layer
|
||||
*
|
||||
*/
|
||||
~Output();
|
||||
|
||||
/**
|
||||
* @brief Forward pass of the output layer. Just copies the input from device to host
|
||||
*
|
||||
* @param input Device pointer to the input vector
|
||||
* @return Host pointer to the output vector
|
||||
*/
|
||||
float* forward(const float* input);
|
||||
/**
|
||||
* @brief Forward pass of the output layer. Just copies the input from
|
||||
* device to host
|
||||
*
|
||||
* @param input Device pointer to the input vector
|
||||
* @return Host pointer to the output vector
|
||||
*/
|
||||
float* forward(const float* input);
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
float* h_output;
|
||||
/**
|
||||
* @brief Get output size
|
||||
*
|
||||
* @return int output size
|
||||
*/
|
||||
int getOutputSize();
|
||||
|
||||
/**
|
||||
* @brief Get input size
|
||||
*
|
||||
* @return int input size
|
||||
*/
|
||||
int getInputSize();
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
float* h_output;
|
||||
};
|
||||
|
||||
|
||||
} // namespace CUDANet::Layers
|
||||
} // namespace CUDANet::Layers
|
||||
|
||||
#endif // CUDANET_OUTPUT_LAYER_H
|
||||
Reference in New Issue
Block a user