Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ class ConstantOfShapeBase {
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");
for (auto dim : t_proto_p->dims()) {
ORT_ENFORCE(dim == 1, "The value attribute of ConstantOfShape must be a single-element tensor");
}
SetValueFromTensorProto(*t_proto_p);
} else {
float f_value = 0.f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ struct int64s final {
const int64_t* data() const { return g_host->int64s__data(this); }
const int64_t& operator[](int index) const { return Get(index); }
void Reserve(int size) { g_host->int64s__Reserve(this, size); }
const int64_t* begin() const { return data(); }
const int64_t* end() const { return data() + size(); }
PROVIDER_DISALLOW_ALL(int64s)
};

Expand Down
Loading