提交 45f8baf1 authored 作者: Frederic's avatar Frederic

Removed a few old tag.shape and vec_length left.

They should not have been used anymore as they should have been removed already.
上级 8af3f78f
...@@ -4175,10 +4175,6 @@ class Join(Op): ...@@ -4175,10 +4175,6 @@ class Join(Op):
outputs = [output_maker(bcastable)] outputs = [output_maker(bcastable)]
node = Apply(self, inputs, outputs) node = Apply(self, inputs, outputs)
if python_any(not x.type.broadcastable[0] for x in orig):
node.tag.shape_zero = None
else:
node.tag.shape_zero = len(orig)
return node return node
def perform(self, node, axis_and_tensors, out_): def perform(self, node, axis_and_tensors, out_):
...@@ -4225,17 +4221,6 @@ class Join(Op): ...@@ -4225,17 +4221,6 @@ class Join(Op):
[slice(None)] * (n_dims - axis - 1)] \ [slice(None)] * (n_dims - axis - 1)] \
for k in xrange(len(sizes_along_axis))] for k in xrange(len(sizes_along_axis))]
def vec_length(self, node):
"""Guess the length of a Join Variable"""
assert isinstance(node.owner.op, Join)
if node.ndim != 1:
raise TypeError('argument must be symbolic vector')
if node.owner.tag.shape_zero is None:
raise ValueError("could not determine vector length")
else:
return node.owner.tag.shape_zero
def infer_shape(self, node, ishapes): def infer_shape(self, node, ishapes):
# ishapes[0] contains the size of the axis on which we join # ishapes[0] contains the size of the axis on which we join
# Join op should get at least one input to join # Join op should get at least one input to join
...@@ -4427,11 +4412,6 @@ def get_vector_length(v): ...@@ -4427,11 +4412,6 @@ def get_vector_length(v):
return 1 return 1
if isinstance(v, gof.Constant) and v.type.ndim == 1: if isinstance(v, gof.Constant) and v.type.ndim == 1:
return len(v.data) return len(v.data)
if v.owner and isinstance(v.owner.op, Join):
try:
return join.vec_length(v)
except ValueError:
pass
if v.owner and isinstance(v.owner.op, theano.tensor.opt.MakeVector): if v.owner and isinstance(v.owner.op, theano.tensor.opt.MakeVector):
return len(v.owner.inputs) return len(v.owner.inputs)
if v.owner and isinstance(v.owner.op, Shape): if v.owner and isinstance(v.owner.op, Shape):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论