@Test public void testDataAssociations() throws PythonException{ PythonVariables pythonVariables = new PythonVariables(); PythonType[] types = { PythonType.INT, PythonType.FLOAT, PythonType.STR, PythonType.BOOL, PythonType.DICT, PythonType.LIST, PythonType.LIST, PythonType.NDARRAY, PythonType.BYTES }; INDArray arr = Nd4j.scalar(1.0); ((BaseDataBuffer)arr.data()).syncToPrimary(); BytePointer bp = new BytePointer(arr.data().pointer()); Object[] values = { 1L,1.0,"1",true, Collections.singletonMap("1",1), new Object[]{1}, Arrays.asList(1), arr, bp }; Object[] expectedValues = { 1L,1.0,"1",true, Collections.singletonMap("1",1), Arrays.asList(1), Arrays.asList(1), arr, bp }; for(int i = 0; i < types.length; i++) { testInsertGet(pythonVariables,types[i].getName().name() + i,values[i],types[i],expectedValues[i]); } assertEquals(types.length,pythonVariables.getVariables().length); }
public String[] getVariables() { String[] strArr = new String[vars.size()]; return vars.keySet().toArray(strArr); }
PythonVariables implements java.io.Serializable { public String[] getVariables() { String[] strArr = new String[vars.size()]; return vars.keySet().toArray(strArr); } }
PythonVariables implements java.io.Serializable { public String[] getVariables() { String[] strArr = new String[vars.size()]; return vars.keySet().toArray(strArr); } PythonVariables(); }
PythonVariables implements java.io.Serializable { public String[] getVariables() { String[] strArr = new String[vars.size()]; return vars.keySet().toArray(strArr); } PythonVariables(); PythonVariables copySchema(); boolean isEmpty(); void add(String name, PythonType type); void add(String name, PythonType type, Object value); void addDict(String name); void addBool(String name); void addStr(String name); void addInt(String name); void addFloat(String name); void addNDArray(String name); void addList(String name); void addBool(String name, boolean value); void addStr(String name, String value); void addInt(String name, int value); void addInt(String name, long value); void addFloat(String name, double value); void addFloat(String name, float value); void addNDArray(String name, NumpyArray value); void addNDArray(String name, INDArray value); void addList(String name, Object[] value); void addDict(String name, java.util.Map value); void addBytes(String name); void addBytes(String name, BytePointer value); void setValue(String name, Object value); Object getValue(String name); boolean getBooleanValue(String name); java.util.Map<?, ?> getDictValue(String name); String getStrValue(String name); Long getIntValue(String name); Double getFloatValue(String name); INDArray getNDArrayValue(String name); List getListValue(String name); BytePointer getBytesValue(String name); PythonType getType(String name); String[] getVariables(); org.json.JSONArray toJSON(); static PythonVariables schemaFromMap(java.util.Map<String, String> inputTypes); static PythonVariables fromJSON(org.json.JSONArray jsonArray); }
PythonVariables implements java.io.Serializable { public String[] getVariables() { String[] strArr = new String[vars.size()]; return vars.keySet().toArray(strArr); } PythonVariables(); PythonVariables copySchema(); boolean isEmpty(); void add(String name, PythonType type); void add(String name, PythonType type, Object value); void addDict(String name); void addBool(String name); void addStr(String name); void addInt(String name); void addFloat(String name); void addNDArray(String name); void addList(String name); void addBool(String name, boolean value); void addStr(String name, String value); void addInt(String name, int value); void addInt(String name, long value); void addFloat(String name, double value); void addFloat(String name, float value); void addNDArray(String name, NumpyArray value); void addNDArray(String name, INDArray value); void addList(String name, Object[] value); void addDict(String name, java.util.Map value); void addBytes(String name); void addBytes(String name, BytePointer value); void setValue(String name, Object value); Object getValue(String name); boolean getBooleanValue(String name); java.util.Map<?, ?> getDictValue(String name); String getStrValue(String name); Long getIntValue(String name); Double getFloatValue(String name); INDArray getNDArrayValue(String name); List getListValue(String name); BytePointer getBytesValue(String name); PythonType getType(String name); String[] getVariables(); org.json.JSONArray toJSON(); static PythonVariables schemaFromMap(java.util.Map<String, String> inputTypes); static PythonVariables fromJSON(org.json.JSONArray jsonArray);  }