diff --git a/mindspore/ccsrc/backend/kernel_compiler/gpu/data/dataset_utils.cc b/mindspore/ccsrc/backend/kernel_compiler/gpu/data/dataset_utils.cc index 8d47e32d1c5..9ef95588a19 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/gpu/data/dataset_utils.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/gpu/data/dataset_utils.cc @@ -77,6 +77,10 @@ void GetShapeAndType(const CNodePtr &kernel_node, std::vector> std::vector shape; (void)std::transform(values.begin(), values.end(), std::back_inserter(shape), [](const int64_t &value) { return static_cast(value); }); + // Empty means scalar. Push one elements for bytes calculation. + if (shape.empty()) { + shape.push_back(1); + } return shape; });