提交 d42672be authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Commit 2

上级 d50fa534
......@@ -2,7 +2,6 @@ import numpy as np
import numpy
import warnings
import theano
import theano.tensor as T
from theano.tensor import basic
from theano.tensor import nlinalg
......@@ -1023,22 +1022,22 @@ class Unique(theano.Op):
" from version 1.9.0.")
def make_node(self, x):
x = T.as_tensor_variable(x)
x = basic.as_tensor_variable(x)
#x = x.flatten()
outputs = []
# output0 = T.TensorType(broadcastable=[False], dtype=x.dtype)()
# output0 = basic.TensorType(broadcastable=[False], dtype=x.dtype)()
output0 = x.flatten().type()
outputs.append(output0)
typ = T.TensorType(broadcastable=[False], dtype='int64')
typ = basic.TensorType(broadcastable=[False], dtype='int64')
if self.return_index :
output1 = typ()
outputs.append(output1)
if self.return_inverse :
output2 = typ()#T.TensorType(broadcastable=[False], dtype=x.dtype)
output2 = typ()
outputs.append(output2)
if self.return_counts :
output3 = typ()#T.TensorType(broadcastable=[False], dtype=x.dtype)
output3 = typ()
outputs.append(output3)
return theano.Apply(self, [x], outputs)
......@@ -1072,4 +1071,3 @@ class Unique(theano.Op):
ret[1] = shape
return ret
return ret
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论