diff --git a/include/tvm/topi/x86/injective.h b/include/tvm/topi/x86/injective.h index 16eaee659564..cc1f48c86005 100644 --- a/include/tvm/topi/x86/injective.h +++ b/include/tvm/topi/x86/injective.h @@ -51,7 +51,7 @@ inline Schedule schedule_injective_from_existing(Schedule sch, const Tensor& out auto c = axis[1]; auto fused = detail::Fuse(sch[out], {n, c}); // for nhwc layout, fuse n and h sch[out].parallel(fused); - } else { + } else if (!axis.empty()) { sch[out].parallel(axis[0]); } return sch;