MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
Extension.cs
1using MyCaffe.common;
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7
9{
14 public class Extension<T> : IDisposable
15 {
16 IXMyCaffeExtension<T> m_iextension;
17 long m_hExtension = 0;
18
22 public enum FUNCTION
23 {
27 INITIALIZE = 1,
31 CLEANUP = 2,
35 SETMEMORY = 3,
39 ADDDATA = 4,
43 PROCESSDATA = 5,
47 GETVISUALIZATION = 6,
51 CLEAR = 7
52 }
53
59 {
60 m_iextension = iextension;
61 }
62
66 public void Dispose()
67 {
68 if (m_hExtension != 0)
69 {
70 Run(FUNCTION.CLEANUP);
71 m_iextension.FreeExtension(m_hExtension);
72 m_hExtension = 0;
73 }
74 }
75
80 public void Initialize(string strPath)
81 {
82 if (m_hExtension != 0)
83 m_iextension.FreeExtension(m_hExtension);
84
85 m_hExtension = m_iextension.CreateExtension(strPath);
86 }
87
92 public void Run(FUNCTION fn)
93 {
94 m_iextension.RunExtension(m_hExtension, (long)fn, null);
95 }
96
103 public double[] Run(FUNCTION fn, double[] rgParam)
104 {
105 return m_iextension.RunExtensionD(m_hExtension, (long)fn, rgParam);
106 }
107
114 public float[] Run(FUNCTION fn, float[] rgParam)
115 {
116 return m_iextension.RunExtensionF(m_hExtension, (long)fn, rgParam);
117 }
118 }
119}
The Extension class is used to add new pre-processor extension DLL's to MyCaffe.
Definition: Extension.cs:15
double[] Run(FUNCTION fn, double[] rgParam)
Run a function on the pre-processor DLL with arguments.
Definition: Extension.cs:103
void Run(FUNCTION fn)
Run a function on the pre-processor DLL without any arguments.
Definition: Extension.cs:92
void Dispose()
Release the processor extension.
Definition: Extension.cs:66
Extension(IXMyCaffeExtension< T > iextension)
The constructor.
Definition: Extension.cs:58
float[] Run(FUNCTION fn, float[] rgParam)
Run a function on the pre-processor DLL with arguments.
Definition: Extension.cs:114
void Initialize(string strPath)
Initialize a new pre-processor extension and load it.
Definition: Extension.cs:80
The IXMyCaffeExtension interface allows for easy extension management of the low-level software that ...
Definition: Interfaces.cs:614
The MyCaffe.common namespace contains common MyCaffe classes.
Definition: BatchInput.cs:8
The MyCaffe.preprocessor namespace contains all classes of the data preprocessors supported by MyCaff...
Definition: Extension.cs:9
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12