FLImaging 7.8.25.3
ComputationalGraphIndexGather.h
1#pragma once
2#if _MSC_VER >= 1900 && defined(_M_X64)
3
4#include "ComputationalGraph.h"
5#include <vector>
6
7namespace FLImaging
8{
9 namespace AI
10 {
11 template <typename T>
12 class FL_EXPORT CComputationalGraphIndexGather : public CComputationalGraph<T>
13 {
14 private:
15 CComputationalGraphIndexGather();
16
17 protected:
18 CComputationalGraphIndexGather(const CComputationalGraphIndexGather<T>& cg);
19
20 public:
21 CComputationalGraphIndexGather(const CComputationalBase<T>& cbOperand, const CComputationalBase<T>& cbIndex);
22 virtual ~CComputationalGraphIndexGather();
23
24 virtual CTensor<T>& Forward() override;
25 virtual CTensor<T>* Backward() override;
26 virtual CComputationalBase<T>* Clone() const override;
27
28 virtual const std::vector<int64_t>& GetEstimatedShape(bool bRecursive = true) const override;
29 virtual const CResult PrintNodeParamInfo() const override;
30
31 virtual const CResult GetBinaryData(Base::CFLData& fldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
32 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
33
34 virtual const CResult SetBinaryData(const Base::CFLData& fldBinary, int64_t* pI64Offset = nullptr) override;
35 virtual const CResult SetBinaryData(const Base::CFLData* pFldBinary, int64_t* pI64Offset = nullptr) override;
36
37 DeclareGetClassType();
38 SupportToDuplicateObjectWithoutCreateNewObject(CComputationalGraphIndexGather, *this);
39
40 protected:
41
42 public:
43 DeclareGetSignletonObject(CComputationalGraphIndexGather);
44 };
45
46 #define CCGFIndexGather(...) (*(new CComputationalGraphIndexGather<float>(__VA_ARGS__)))
47 #define CCGDIndexGather(...) (*(new CComputationalGraphIndexGather<double>(__VA_ARGS__)))
48
49 #define CCGTIndexGather(T, ...) (*(new CComputationalGraphIndexGather<T>(__VA_ARGS__)))
50 }
51}
52
53#endif
54
Definition AlgorithmAIBase.h:18