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