提交 f948e29b authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Use correct NumPy dtype object for Cast.ctor

上级 f26b8d2b
...@@ -2413,7 +2413,7 @@ class Cast(UnaryScalarOp): ...@@ -2413,7 +2413,7 @@ class Cast(UnaryScalarOp):
raise TypeError(o_type) raise TypeError(o_type)
super().__init__(specific_out(o_type), name=name) super().__init__(specific_out(o_type), name=name)
self.o_type = o_type self.o_type = o_type
self.ctor = getattr(np, o_type.dtype) self.ctor = np.dtype(o_type.dtype).type
def __str__(self): def __str__(self):
return f"{self.__class__.__name__}{{{self.o_type.dtype}}}" return f"{self.__class__.__name__}{{{self.o_type.dtype}}}"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论