diff --git a/include/custom_op/custom_op_lite.h b/include/custom_op/custom_op_lite.h index b667d4cf0..44eed159e 100644 --- a/include/custom_op/custom_op_lite.h +++ b/include/custom_op/custom_op_lite.h @@ -217,7 +217,9 @@ class OrtStringViewTensorStorage : public IStringTensorStorage size_t num_strings = 1; if ((*shape_).size() > 0) { - num_strings = static_cast((*shape_)[0]); + for (auto dim : *shape_) { + num_strings *= static_cast(dim); + } } if (num_strings) {