We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7736732 commit 2b06fa1Copy full SHA for 2b06fa1
theano/tensor/basic.py
@@ -440,7 +440,7 @@ def get_scalar_constant_value(
440
i = v.owner.op.i
441
inp = v.owner.inputs[0]
442
if isinstance(inp, Constant):
443
- return np.asarray(inp.data.shape[i])
+ return np.asarray(np.shape(inp.data)[i])
444
# The shape of a broadcastable dimension is 1
445
if hasattr(inp.type, "broadcastable") and inp.type.broadcastable[i]:
446
return np.asarray(1)
@@ -638,7 +638,7 @@ def get_scalar_constant_value(
638
639
640
if isinstance(grandparent, Constant):
641
- return np.asarray(grandparent.data.shape[idx])
+ return np.asarray(np.shape(grandparent.data)[idx])
642
643
raise NotScalarConstantError(v)
644
0 commit comments