mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-29 23:06:41 +00:00
Fix a bug in Maxpool v8
This commit is contained in:
parent
dee4fc8b8a
commit
5f6ec8ea6d
2 changed files with 5 additions and 8 deletions
|
|
@ -17,8 +17,8 @@ struct PoolAttributes {
|
|||
}
|
||||
|
||||
PoolAttributes(const OpNodeProtoHelper<ProtoHelperNodeContext>& info,
|
||||
const std::string& op_name, int start_ver_p)
|
||||
: global_pooling(IsGlobalPooling(op_name)), start_version(start_ver_p) {
|
||||
const std::string& op_name, int start_version)
|
||||
: global_pooling(IsGlobalPooling(op_name)) {
|
||||
if (global_pooling) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -57,8 +57,8 @@ struct PoolAttributes {
|
|||
}
|
||||
|
||||
if (op_name == "MaxPool") {
|
||||
if (start_version == 8) {
|
||||
storage_order = info.GetAttrOrDefault<int64_t>("storage_order", 0 /*default_value*/);
|
||||
if (start_version >= 8) {
|
||||
ORT_ENFORCE(info.GetAttr("storage_order", &storage_order).IsOK());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,6 @@ struct PoolAttributes {
|
|||
}
|
||||
|
||||
const bool global_pooling;
|
||||
const int start_version;
|
||||
|
||||
bool count_include_pad{};
|
||||
int64_t storage_order{0}; // MaxPool_8 only. 0 is row major, and 1 is column major. Default is 0.
|
||||
|
|
|
|||
|
|
@ -101,9 +101,7 @@ class LpPool {
|
|||
class PoolBase {
|
||||
private:
|
||||
static int GetStartVersion(const OpKernelInfo& info) {
|
||||
int start, end;
|
||||
info.GetKernelDef().SinceVersion(&start, &end);
|
||||
return start;
|
||||
return info.node().Op()->since_version();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Reference in a new issue