Ejemplo n.º 1
0
 def python_eval_func(data):
     num_nodes = len(get_nodes_by_type(node))
     # It has to be this way - otherwise the data doesn't appear contiguous in CPP.
     # np.ascontiguousarray doesn't seem to work either.
     results = []
     for _ in range(num_nodes):
         results += np.zeros(shape=(data.shape[0]), dtype="float32").tolist()
     results = np.array(results).reshape((data.shape[0], num_nodes))
     spn_many(data, results, results.shape[0])
     return results
Ejemplo n.º 2
0
 def python_eval_func(data):
     results = np.zeros((data.shape[0], 1))
     spn_many(data, results, data.shape[0])
     return results