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

Commit 2

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