Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@
auto* t_proto_p = t_proto.get();
#endif
if (info.GetAttr<ONNX_NAMESPACE::TensorProto>("value", t_proto_p).IsOK()) {
ORT_ENFORCE(t_proto_p->dims_size() == 1, "Must have a single dimension");
ORT_ENFORCE(t_proto_p->dims()[0] == 1, "Must have a single dimension of 1");
ORT_ENFORCE(

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'std::accumulate': no matching overloaded function found

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'end': is not a member of 'onnx::int64s'

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU CUDA CI Pipeline

'begin': is not a member of 'onnx::int64s'

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'std::accumulate': no matching overloaded function found

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'end': is not a member of 'onnx::int64s'

Check failure on line 81 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Windows GPU TensorRT CI Pipeline

'begin': is not a member of 'onnx::int64s'
t_proto_p->dims_size() == 0 ||
std::accumulate(
t_proto_p->dims().begin(),
t_proto_p->dims().end(),
1,
std::multiplies<size_t>()) == 1,

Check warning on line 87 in onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <functional> for multiplies<> [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/cpu/generator/constant_of_shape_base.h:87: Add #include <functional> for multiplies<> [build/include_what_you_use] [4]
"The value attribute of ConstantOfShape must be a single-element tensor");
SetValueFromTensorProto(*t_proto_p);
} else {
float f_value = 0.f;
Expand Down
Loading