FLImaging 6.8.21.2
BackendReLU.h
1#pragma once
2
3#if _MSC_VER >= 1900 && defined(_M_X64)
4
5#include "BackendBase.h"
6
7namespace FLImaging
8{
9 namespace AI
10 {
11 template <typename T>
12 class FL_EXPORT CTensor;
13
14 template <typename T>
15 class FL_EXPORT CBackendReLU : public CBackendBase<T>
16 {
17 public:
18 CBackendReLU();
19 CBackendReLU(const CBackendReLU<T>& bf);
20 virtual ~CBackendReLU();
21
22 virtual const CResult Forward(const CTensor<T>* pTsrOperand, CTensor<T>* pTsrResult, bool bInplace, bool bRetained, int8_t* pReserveBuffer, size_t stReserveSize, int32_t i32DeviceIndex);
23 virtual const CResult Backward(const CTensor<T>* pTsrOperand, CTensor<T>* pTsrResult, CTensor<T>* pTsrX, bool bAddGradient, bool bInplace, bool bRetained, int8_t* pReserveBuffer);
24
25 DeclareGetClassType();
26 SupportToDuplicateObjectWithoutCreateNewObject(CBackendReLU<T>, *this);
27
28 private:
29 int64_t m_i64KernelX;
30 int64_t m_i64KernelY;
31 int64_t m_i64StrideX;
32 int64_t m_i64StrideY;
33 int64_t m_i64PaddingX;
34 int64_t m_i64PaddingY;
35
36 };
37 }
38}
39
40#endif