@@ -203,6 +203,9 @@ def slice(self, **kwargs):
203203 def find_indices (self , op , ** kwargs ):
204204 return find_indices (self , op , ** kwargs )
205205
206+ def shape_ (self , ** kwargs ):
207+ return shape (self , ** kwargs )
208+
206209 # Comparison Ops
207210 def greater (self , op1 , ** kwargs ):
208211 return greater (self , op1 , ** kwargs )
@@ -326,6 +329,8 @@ def __str__(self):
326329 self ._op_db .operator ,
327330 self .output ,
328331 self .status )
332+ def __call__ (self , * args , ** kwargs ):
333+ return self .output
329334
330335
331336class Scalar (Op ):
@@ -368,6 +373,9 @@ def __str__(self):
368373 return "Scalar Op:\n Id:{}\n Output:{}\n Status:{}\n Dtype:{}\n " .format (self .id , self .output ,
369374 self .status , self .dtype )
370375
376+ def __call__ (self , * args , ** kwargs ):
377+ return self .output
378+
371379
372380class Tensor (Op ):
373381 """
@@ -411,6 +419,9 @@ def __str__(self):
411419 return "Tensor Op:\n Id:{}\n Output:{}\n Status:{}\n Dtype:{}\n " .format (self .id , self .output ,
412420 self .status , self .dtype )
413421
422+ def __call__ (self , * args , ** kwargs ):
423+ return self .output
424+
414425
415426class Data (object ):
416427 def __init__ (self , id = None , value = None , dtype = None , ** kwargs ):
@@ -471,6 +482,9 @@ def dtype(self):
471482 def __str__ (self ):
472483 return "Data:\n Id:{}\n Dtype:{}\n " .format (self .id , self .dtype )
473484
485+ def __call__ (self , * args , ** kwargs ):
486+ return self .value
487+
474488
475489class Graph (object ):
476490 """A class to represent a graph object"""
@@ -707,6 +721,10 @@ def find_indices(op, op2, **kwargs):
707721 return __create_math_op (op , op2 , Operators .FIND_INDICES .value , ** kwargs )
708722
709723
724+ def shape (op , ** kwargs ):
725+ return __create_math_op2 (op , Operators .SHAPE .value , ** kwargs )
726+
727+
710728# Comparison
711729def greater (op1 , op2 , ** kwargs ):
712730 return __create_math_op (op1 , op2 , Operators .GREATER .value , ** kwargs )
@@ -797,6 +815,12 @@ def sign(op1, **kwargs):
797815def foreach (op , ** kwargs ):
798816 return __create_math_op2 (op , Operators .FOREACH .value , ** kwargs )
799817
818+ # Data Preprocessing
819+
820+
821+ def one_hot_encoding (op , ** kwargs ):
822+ return __create_math_op2 (op , Operators .ONE_HOT_ENCODING .value , ** kwargs )
823+
800824
801825def __create_math_op (op1 , op2 , operator , ** kwargs ):
802826 if op1 is None or op2 is None :
0 commit comments