提交 807d742d authored 作者: James Bergstra's avatar James Bergstra

added nicer string function for scalar.Cast

上级 f84615fb
...@@ -850,6 +850,8 @@ class Cast(UnaryScalarOp): ...@@ -850,6 +850,8 @@ class Cast(UnaryScalarOp):
super(Cast, self).__init__(specific_out(o_type), name=name) super(Cast, self).__init__(specific_out(o_type), name=name)
self.o_type = o_type self.o_type = o_type
self.ctor = getattr(numpy, o_type.dtype) self.ctor = getattr(numpy, o_type.dtype)
def __str__(self):
return '%s{%s}' % (self.__class__.__name__, self.o_type.dtype)
def impl(self, input): def impl(self, input):
return self.ctor(input) return self.ctor(input)
def c_code(self, node, name, (x, ), (z, ), sub): def c_code(self, node, name, (x, ), (z, ), sub):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论