File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
onnxruntime/core/providers/js/operators Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ class Unsqueeze final : public JsKernel, public UnsqueezeBase {
26
26
if (num_inputs == 2 ) { // axes is an input
27
27
const Tensor* axes_tensor = context->Input <Tensor>(1 );
28
28
ORT_ENFORCE (axes_tensor != nullptr , " Axes input is null" );
29
- ORT_ENFORCE (axes_tensor->Shape ().NumDimensions () == 1 ,
30
- " An axes tensor must be a vector tensor." );
29
+ ORT_ENFORCE (axes_tensor->Shape ().NumDimensions () == 0 ||
30
+ axes_tensor->Shape ().NumDimensions () == 1 ,
31
+ " An axes tensor must be a scalar or a vector tensor." );
31
32
auto nDims = static_cast <size_t >(axes_tensor->Shape ()[0 ]);
32
33
const auto * data = axes_tensor->Data <int64_t >();
33
34
axes.assign (data, data + nDims);
You can’t perform that action at this time.
0 commit comments