Commit c8abfc67 authored by BruceDai's avatar BruceDai Committed by aborovova@mozilla.com
Browse files

Bug 1967185 [wpt PR 52629] - webnn: update tests align with latest WebNN API Spec change for pad(),

Automatic update from web-platform-tests
webnn: update tests align with latest WebNN API Spec change for pad()

This CL is to update tests align with latest WebNN API Spec change for
pad()[1] by removing one conformance test with symmetric padding mode
and adding four validation tests of restrict the padding size for
reflection model. The failure validation tests are tracked by
issue#417227410[2].

[1] https://github.com/webmachinelearning/webnn/pull/843
[2] https://issues.chromium.org/issues/417227410

Bug: 416604162
Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d
Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861


Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarningxin hu <ningxin.hu@intel.com>
Auto-Submit: Feng Dai <feng.dai@intel.com>
Commit-Queue: Feng Dai <feng.dai@intel.com>
Cr-Commit-Position: refs/heads/main@{#1461938}

--

wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a
wpt-pr: 52629

Differential Revision: https://phabricator.services.mozilla.com/D250693
parent fc0c9ba2
Loading
Loading
Loading
Loading
+1 −49
Original line number Diff line number Diff line
@@ -14,8 +14,7 @@
// enum MLPaddingMode {
//   "constant",
//   "edge",
//   "reflection",
//   "symmetric"
//   "reflection"
// };
//
// dictionary MLPadOptions {
@@ -677,53 +676,6 @@ const padTests = [
        }
      }
    }
  },
  {
    'name': 'pad float32 4D tensor options.mode=\'symmetric\'',
    'graph': {
      'inputs': {
        'padInput': {
          'data': [
            22.76361846923828, -21.168529510498047, -91.66168975830078,
            16.863798141479492, 60.51472091674805, -70.56755065917969,
            -60.643272399902344, -47.8821907043457, 68.72557830810547
          ],
          'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'}
        }
      },
      'operators': [{
        'name': 'pad',
        'arguments': [
          {'input': 'padInput'}, {'beginningPadding': [0, 2, 2, 0]},
          {'endingPadding': [0, 2, 2, 0]}, {'options': {'mode': 'symmetric'}}
        ],
        'outputs': 'padOutput'
      }],
      'expectedOutputs': {
        'padOutput': {
          'data': [
            60.51472091674805,   16.863798141479492,  16.863798141479492,
            60.51472091674805,   -70.56755065917969,  -70.56755065917969,
            60.51472091674805,   -21.168529510498047, 22.76361846923828,
            22.76361846923828,   -21.168529510498047, -91.66168975830078,
            -91.66168975830078,  -21.168529510498047, -21.168529510498047,
            22.76361846923828,   22.76361846923828,   -21.168529510498047,
            -91.66168975830078,  -91.66168975830078,  -21.168529510498047,
            60.51472091674805,   16.863798141479492,  16.863798141479492,
            60.51472091674805,   -70.56755065917969,  -70.56755065917969,
            60.51472091674805,   -47.8821907043457,   -60.643272399902344,
            -60.643272399902344, -47.8821907043457,   68.72557830810547,
            68.72557830810547,   -47.8821907043457,   -47.8821907043457,
            -60.643272399902344, -60.643272399902344, -47.8821907043457,
            68.72557830810547,   68.72557830810547,   -47.8821907043457,
            60.51472091674805,   16.863798141479492,  16.863798141479492,
            60.51472091674805,   -70.56755065917969,  -70.56755065917969,
            60.51472091674805
          ],
          'descriptor': {shape: [1, 7, 7, 1], dataType: 'float32'}
        }
      }
    }
  }
];

+44 −0
Original line number Diff line number Diff line
@@ -82,6 +82,50 @@ const tests = [
      label: label,
    },
  },
  {
    name:
        '[pad] Throw if beginningPadding[index] is equal to inputShape[index] on reflection mode.',
    input: {dataType: 'float32', shape: [2, 3]},
    beginningPadding: [2, 0],
    endingPadding: [1, 2],
    options: {
      mode: 'reflection',
      label: label,
    },
  },
  {
    name:
        '[pad] Throw if beginningPadding[index] is greater than inputShape[index] on reflection mode.',
    input: {dataType: 'float32', shape: [2, 3]},
    beginningPadding: [3, 0],
    endingPadding: [1, 2],
    options: {
      mode: 'reflection',
      label: label,
    },
  },
  {
    name:
        '[pad] Throw if endingPadding[index] is equal to inputShape[index] on reflection mode.',
    input: {dataType: 'float32', shape: [2, 3]},
    beginningPadding: [1, 0],
    endingPadding: [1, 3],
    options: {
      mode: 'reflection',
      label: label,
    },
  },
  {
    name:
        '[pad] Throw if endingPadding[index] is greater than inputShape[index] on reflection mode.',
    input: {dataType: 'float32', shape: [2, 3]},
    beginningPadding: [1, 0],
    endingPadding: [1, 4],
    options: {
      mode: 'reflection',
      label: label,
    },
  },
  {
    name: '[pad] Throw if the padding of one dimension is too large.',
    input: {dataType: 'float32', shape: [2, 3]},