3#if _MSC_VER >= 1900 && defined(_M_X64)
5#include "ComputationalGraph.h"
14 class FL_EXPORT CComputationalGraphReshape :
public CComputationalGraph<T>
17 CComputationalGraphReshape();
20 CComputationalGraphReshape(
const CComputationalGraphReshape<T>& cg);
23 CComputationalGraphReshape(
const CComputationalBase<T>& cbOperand);
24 CComputationalGraphReshape(
const CComputationalBase<T>& cbOperand,
const CComputationalBase<T>& cbReferenceShape);
25 CComputationalGraphReshape(
const CComputationalBase<T>& cbOperand,
const std::vector<int64_t>& vctReshape);
26 CComputationalGraphReshape(
const CComputationalBase<T>& cbOperand,
const std::initializer_list<int64_t>& ilReshape);
27 virtual ~CComputationalGraphReshape();
29 virtual CTensor<T>& Forward()
override;
30 virtual CTensor<T>* Backward()
override;
31 virtual CComputationalBase<T>* Clone()
const override;
33 virtual const CResult Swap(CComputationalBase<T>& cbSwap)
override;
34 virtual const std::vector<int64_t>& GetEstimatedShape(
bool bRecursive =
true)
const override;
36 virtual const CResult GetBinaryData(Base::CFLData& fldBinary,
bool bSuperClass =
false, int32_t i32Version = -1,
bool bDumpMode =
false)
const override;
37 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary,
bool bSuperClass =
false, int32_t i32Version = -1,
bool bDumpMode =
false)
const override;
39 virtual const CResult SetBinaryData(
const Base::CFLData& fldBinary, int64_t* pI64Offset =
nullptr)
override;
40 virtual const CResult SetBinaryData(
const Base::CFLData* pFldBinary, int64_t* pI64Offset =
nullptr)
override;
42 virtual const CResult PrintNodeParamInfo()
const override;
44 virtual const CResult SetReShape(
const std::vector<int64_t> vctShape);
45 const std::vector<int64_t>& GetReShape()
const;
47 DeclareGetClassType();
48 SupportToDuplicateObjectWithoutCreateNewObject(CComputationalGraphReshape, *
this);
51 std::vector<int64_t>& m_vctReshape;
53 DeclareGetSignletonObject(CComputationalGraphReshape);
56 #define CCGFReshape(...) (*(new CComputationalGraphReshape<float>(__VA_ARGS__)))
57 #define CCGDReshape(...) (*(new CComputationalGraphReshape<double>(__VA_ARGS__)))
59 #define CCGTReshape(T, ...) (*(new CComputationalGraphReshape<T>(__VA_ARGS__)))