Skip to content

Commit aa1a6da

Browse files
authored
Fail if no reduction axis is given (#198)
Closes #186
1 parent 258a443 commit aa1a6da

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/csrc/jit/codegen/cuda/arith.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ TensorView* reductionOp(
455455

456456
TORCH_CHECK(tv->nDims() > 0, "Tried to reduce a 0-dim tensor");
457457

458+
TORCH_CHECK(axes.size() > 0, "No reduction axis specified");
459+
458460
std::vector<unsigned int> uint_axes;
459461
for (int axis : axes) {
460462
if (axis < 0)

0 commit comments

Comments
 (0)