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.
shape_padright
.reshape
1 parent 8f213a3 commit be6ed82Copy full SHA for be6ed82
pytensor/tensor/extra_ops.py
@@ -1623,7 +1623,7 @@ def _linspace_core(
1623
) -> TensorVariable | tuple[TensorVariable, TensorVariable]:
1624
div = (num - 1) if endpoint else num
1625
delta = stop - start
1626
- samples = ptb.arange(0, num).reshape((-1,) + (1,) * delta.ndim)
+ samples = ptb.shape_padright(ptb.arange(0, num), delta.ndim)
1627
1628
step = delta / div
1629
samples = switch(gt(div, 0), samples * delta / div + start, samples * delta + start)
0 commit comments