提交 6eb6bfd0 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed crash with MacOS X where numpy.asarray(list of integers) returns an int32 array

上级 776fff45
......@@ -764,8 +764,10 @@ class CrossentropyCategorical1Hot(gof.Op):
_true_one_of_n = tensor.as_tensor_variable(true_one_of_n)
if _coding_dist.type.ndim != 2:
raise TypeError('matrix required for argument: coding_dist')
if _true_one_of_n.type != tensor.lvector:
raise TypeError('integer vector required for argument: true_one_of_n')
if _true_one_of_n.type not in (tensor.lvector, tensor.ivector):
raise TypeError('integer vector required for argument: true_one_of_n'
'(got type: %s instead of: %s)' % (_true_one_of_n.type,
tensor.lvector))
return gof.Apply(self, [_coding_dist, _true_one_of_n], [tensor.dvector()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论