MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
use PyConverter to convert between python object and clr object. More...
Public Member Functions | |
PyConverter () | |
Constructor More... | |
void | Add (PyClrTypeBase converter) |
Add a new type for conversion. More... | |
void | AddObjectType< T > (PyObject pyType, PyConverter converter=null) |
Add a new PyObjec type to the converter. More... | |
void | AddListType (PyConverter converter=null) |
Add a new list type to the converter. More... | |
void | AddListType< T > (PyConverter converter=null) |
Add a new list type to the converter. More... | |
void | AddDictType< K, V > (PyConverter converter=null) |
Add a new dictionary type of K key types and V value types. More... | |
T | ToClr< T > (PyObject obj) |
Convert the PyObject to a specifict type T More... | |
object | ToClr (PyObject obj, Type t=null) |
Convert a PyObject to a clr type of 't'. More... | |
PyObject | ToPython (object clrObj, IntPtr? t=null) |
Convert a clr object to a PyObject. More... | |
use PyConverter to convert between python object and clr object.
Open-source public code originally shared from:
Definition at line 15 of file PyConverter.cs.
Python.Runtime.PyConverter.PyConverter | ( | ) |
Constructor
Definition at line 20 of file PyConverter.cs.
void Python.Runtime.PyConverter.Add | ( | PyClrTypeBase | converter | ) |
Add a new type for conversion.
converter | Specifies the converter. |
Definition at line 37 of file PyConverter.cs.
void Python.Runtime.PyConverter.AddDictType< K, V > | ( | PyConverter | converter = null | ) |
Add a new dictionary type of K key types and V value types.
K | Specifies the key type. |
V | Specifies the value type. |
converter | Specifies the converter. |
Definition at line 104 of file PyConverter.cs.
void Python.Runtime.PyConverter.AddListType | ( | PyConverter | converter = null | ) |
Add a new list type to the converter.
converter | Specifies the converter. |
Definition at line 79 of file PyConverter.cs.
void Python.Runtime.PyConverter.AddListType< T > | ( | PyConverter | converter = null | ) |
Add a new list type to the converter.
T | Specifies the element type. |
converter | Specifies the converter. |
Definition at line 89 of file PyConverter.cs.
void Python.Runtime.PyConverter.AddObjectType< T > | ( | PyObject | pyType, |
PyConverter | converter = null |
||
) |
Add a new PyObjec type to the converter.
T |
pyType | Specifies the type to add. |
converter | Specifies the converter. |
Definition at line 66 of file PyConverter.cs.
object Python.Runtime.PyConverter.ToClr | ( | PyObject | obj, |
Type | t = null |
||
) |
Convert a PyObject to a clr type of 't'.
obj | Specifies the PyObject to convert. |
t | Specifies the expected clr type. |
Definition at line 130 of file PyConverter.cs.
T Python.Runtime.PyConverter.ToClr< T > | ( | PyObject | obj | ) |
Convert the PyObject to a specifict type T
T | Specifies the type to convert to. |
obj | Specifies the PyObject to convert. |
Definition at line 119 of file PyConverter.cs.
PyObject Python.Runtime.PyConverter.ToPython | ( | object | clrObj, |
IntPtr? | t = null |
||
) |
Convert a clr object to a PyObject.
clrObj | Specifies the clr object to covert. |
t | Specifies the expected Python type. |
Exception | An exception is thrown on error. |
Definition at line 160 of file PyConverter.cs.