提交 a6994e93 authored 作者: sentient07's avatar sentient07

Reverted few changes again and fixed a wrong import

上级 c9300c5d
......@@ -2354,8 +2354,6 @@ def zeros(shape, dtype=None):
shape = [shape]
if dtype is None:
dtype = config.floatX
if isinstance(shape, (list, tuple)) and len(shape) == 0:
return constant(0.0, dtype=dtype)
return alloc(numpy.array(0, dtype=dtype), *shape)
......@@ -2367,8 +2365,6 @@ def ones(shape, dtype=None):
shape = [shape]
if dtype is None:
dtype = config.floatX
if isinstance(shape, (list, tuple)) and len(shape) == 0:
return constant(1.0, dtype=dtype)
return alloc(numpy.array(1, dtype=dtype), *shape)
......
......@@ -2036,7 +2036,7 @@ def local_useless_elemwise(node):
return [node.inputs[0]]
elif (node.op.scalar_op == theano.scalar.identity and
len(node.inputs) == 1):
return
return [node.inputs[0]]
elif (isinstance(node.op.scalar_op, scalar.AND) and
len(node.inputs) == 2):
......
......@@ -39,7 +39,6 @@ from theano.tensor.opt import (
local_useless_reshape,
local_reshape_to_dimshuffle,
mul_canonizer,
out2in,
Shape_i,
Assert,
MakeVector,
......@@ -70,7 +69,7 @@ from theano.tensor.elemwise import DimShuffle
from theano.tests import unittest_tools as utt
from theano.compile.mode import optdb
from theano.compile import Mode
from theano.gof.opt import check_stack_trace
from theano.gof.opt import check_stack_trace, out2in
from nose.plugins.attrib import attr
mode_opt = theano.config.mode
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论