3#if _MSC_VER >= 1900 && defined(_M_X64)
5#include "ComputationalGraph.h"
13 class CCuda_ComputationalGraphSoftmax_CudnnWithLogSoftmax;
17 class FL_EXPORT CComputationalGraphLogSoftmax :
public CComputationalGraph<T>
21 CComputationalGraphLogSoftmax();
24 CComputationalGraphLogSoftmax(
const CComputationalGraphLogSoftmax<T>& cg);
27 CComputationalGraphLogSoftmax(
const CComputationalBase<T>& cbOperand1, int64_t i64Axis = -1);
28 virtual ~CComputationalGraphLogSoftmax();
30 virtual CTensor<T>& Forward()
override;
31 virtual CTensor<T>* Backward()
override;
32 virtual CComputationalBase<T>* Clone()
const override;
34 virtual const std::vector<int64_t>& GetEstimatedShape(
bool bRecursive =
true)
const override;
35 virtual const CResult PrintNodeParamInfo()
const override;
37 virtual const CResult GetBinaryData(Base::CFLData& fldBinary,
bool bSuperClass =
false, int32_t i32Version = -1,
bool bDumpMode =
false)
const override;
38 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary,
bool bSuperClass =
false, int32_t i32Version = -1,
bool bDumpMode =
false)
const override;
40 virtual const CResult SetBinaryData(
const Base::CFLData& fldBinary, int64_t* pI64Offset =
nullptr)
override;
41 virtual const CResult SetBinaryData(
const Base::CFLData* pFldBinary, int64_t* pI64Offset =
nullptr)
override;
43 DeclareGetClassType();
44 SupportToDuplicateObjectWithoutCreateNewObject(CComputationalGraphLogSoftmax, *
this);
47 virtual const CResult LogSoftmax(
const CTensor<T>* pTsrOperand, CTensor<T>* pTsrResult);
48 virtual const CResult LogSoftmax_Cuda(
const CTensor<T>* pTsrOperand, CTensor<T>* pTsrResult);
49 virtual const CResult Dervative(
bool bAddGradient =
false);
50 virtual const CResult Dervative_Cuda(
bool bAddGradient =
false);
53 CTensor<T>* m_pTsrSoftmax;
58 DeclareGetSignletonObject(CComputationalGraphLogSoftmax);
61 #define CCGFLogSoftmax(...) (*(new CComputationalGraphLogSoftmax<float>(__VA_ARGS__)))
62 #define CCGDLogSoftmax(...) (*(new CComputationalGraphLogSoftmax<double>(__VA_ARGS__)))
64 #define CCGTLogSoftmax(T, ...) (*(new CComputationalGraphLogSoftmax<T>(__VA_ARGS__)))