提交 71f01b21 authored 作者: Frederic Bastien's avatar Frederic Bastien

dded some type check into GpuDimShuffle.make_node to have a better error msg.

上级 dd0aa4d3
...@@ -236,6 +236,8 @@ class GpuDimShuffle(Op): ...@@ -236,6 +236,8 @@ class GpuDimShuffle(Op):
if not ib == self.input_broadcastable: if not ib == self.input_broadcastable:
raise TypeError("The number of dimensions and/or broadcastable pattern of the input is incorrect for this op. Expected %s, got %s." % (self.input_broadcastable, ib)) raise TypeError("The number of dimensions and/or broadcastable pattern of the input is incorrect for this op. Expected %s, got %s." % (self.input_broadcastable, ib))
ob = [] ob = []
if not isinstance(input.type, CudaNdarrayType):
raise TypeError("The input of a GpuDimshuffle must be a CudaNdarray")
for value in self.new_order: for value in self.new_order:
if value == 'x': if value == 'x':
ob.append(True) ob.append(True)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论