@@ -29,36 +29,39 @@ def __repr__(self):
2929
3030
3131 for method in api .ew_binary_methods :
32+ METHOD = method .upper ()
3233 exec (
33- f"{ method } = lambda self, other: dtensor(_cdt.ew_binary_op(self._t, ' { method } ', other._t if isinstance(other, dtensor) else other, True))"
34+ f"{ method } = lambda self, other: dtensor(_cdt.EWBinOp.op(_cdt. { METHOD } , self._t, other._t))" # if isinstance(other, dtensor) else other, True))"
3435 )
3536
3637 for method in api .ew_binary_methods_inplace :
38+ METHOD = method .upper ()
3739 exec (
38- f"{ method } = lambda self, other: (self, _cdt.ew_binary_op_inplace(self._t, ' { method } ', other._t if isinstance(other, dtensor) else other))[0]"
40+ f"{ method } = lambda self, other: (self, _cdt.IEWBinOp.op(_cdt. { METHOD } , self._t, other._t))[0]" # if isinstance(other, dtensor) else other))[0]"
3941 )
4042
4143 for method in api .ew_unary_methods :
44+ METHOD = method .upper ()
4245 exec (
43- f"{ method } = lambda self: dtensor(_cdt.ew_unary_op(self._t, ' { method } ', True ))"
46+ f"{ method } = lambda self: dtensor(_cdt.EWUnyOp.op(_cdt. { METHOD } , self._t ))"
4447 )
48+
49+ # for method in unary_methods:
50+ # exec(
51+ # f"{method} = lambda self: self._t.{method}()"
52+ # )
4553
46- for method in unary_methods :
47- exec (
48- f"{ method } = lambda self: self._t.{ method } ()"
49- )
50-
51- for att in t_attributes :
52- exec (
53- f"{ att } = property(lambda self: self._t.{ att } )"
54- )
54+ # for att in t_attributes:
55+ # exec(
56+ # f"{att} = property(lambda self: self._t.{att})"
57+ # )
5558
56- def __getitem__ (self , * args ):
57- x = self ._t .__getitem__ (* args )
58- return dtensor (x )
59+ # def __getitem__(self, *args):
60+ # x = self._t.__getitem__(*args)
61+ # return dtensor(x)
5962
60- def __setitem__ (self , key , value ):
61- x = self ._t .__setitem__ (key , value ._t if isinstance (value , dtensor ) else value )
63+ # def __setitem__(self, key, value):
64+ # x = self._t.__setitem__(key, value._t if isinstance(value, dtensor) else value)
6265
63- def get_slice (self , * args ):
64- return self ._t .get_slice (* args )
66+ # def get_slice(self, *args):
67+ # return self._t.get_slice(*args)
0 commit comments