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