webnn: Define the IDL of operations to support MobileNetV2.

MobileNet models perform image classification, WebNN defines below operations to implement the inference of the model.
1, Conv2d: Compute a 2-D convolution given 4-D input and filter tensors
2, Gemm: Calculate the general matrix multiplication.
3, AveragePool2d: Compute a mean reduction operation across all the elements.
4, Reshape: Alter the shape of a tensor to a new shape
5, Clamp: Clamp the input tensor element-wise within a range specified
6, Softmax: Compute the softmax values of the 2-D input tensor along axis 1.

Bug: 1273291
Change-Id: I79969b678f21ed2064eee9e64e081a0f40fba722
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650912
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
Reviewed-by: Honglin Yu <honglinyu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006292}
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni
index 20068c92..30c4ec66 100644
--- a/third_party/blink/renderer/bindings/generated_in_modules.gni
+++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -643,16 +643,34 @@
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_midi_permission_descriptor.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_auto_pad.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_auto_pad.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context_options.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_context_options.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_filter_operand_layout.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_filter_operand_layout.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_gemm_options.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_gemm_options.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_graph_builder.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_graph_builder.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_input_operand_layout.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_input_operand_layout.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operand_descriptor.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operand_descriptor.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operand.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operand.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operator.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_operator.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_pool_2d_options.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_pool_2d_options.h",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_rounding_type.cc",
+  "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_rounding_type.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.cc",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.h",
   "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_native_io_read_result.cc",
diff --git a/third_party/blink/renderer/bindings/idl_in_modules.gni b/third_party/blink/renderer/bindings/idl_in_modules.gni
index e868eb6e..0c348c6 100644
--- a/third_party/blink/renderer/bindings/idl_in_modules.gni
+++ b/third_party/blink/renderer/bindings/idl_in_modules.gni
@@ -450,6 +450,7 @@
           "//third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl",
           "//third_party/blink/renderer/modules/ml/webnn/ml_operand_descriptor.idl",
           "//third_party/blink/renderer/modules/ml/webnn/ml_operand.idl",
+          "//third_party/blink/renderer/modules/ml/webnn/ml_operator.idl",
           "//third_party/blink/renderer/modules/mojo/mojo_file_system_access.idl",
           "//third_party/blink/renderer/modules/native_io/native_io_file.idl",
           "//third_party/blink/renderer/modules/native_io/native_io_file_manager.idl",
diff --git a/third_party/blink/renderer/modules/ml/webnn/BUILD.gn b/third_party/blink/renderer/modules/ml/webnn/BUILD.gn
index 658d642..7222dbe 100644
--- a/third_party/blink/renderer/modules/ml/webnn/BUILD.gn
+++ b/third_party/blink/renderer/modules/ml/webnn/BUILD.gn
@@ -10,6 +10,8 @@
     "ml_graph_builder.h",
     "ml_operand.cc",
     "ml_operand.h",
+    "ml_operator.cc",
+    "ml_operator.h",
   ]
   deps = [ "//third_party/blink/renderer/modules/ml" ]
 }
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
index 1449ef35f..c9abdd61 100644
--- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
@@ -4,9 +4,14 @@
 
 #include "third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h"
 
+#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.h"
+#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h"
+#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_gemm_options.h"
 #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_operand_descriptor.h"
+#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_pool_2d_options.h"
 #include "third_party/blink/renderer/modules/ml/ml_context.h"
 #include "third_party/blink/renderer/modules/ml/webnn/ml_operand.h"
+#include "third_party/blink/renderer/modules/ml/webnn/ml_operator.h"
 
 namespace blink {
 
@@ -25,20 +30,81 @@
 }
 
 MLOperand* MLGraphBuilder::input(String name, const MLOperandDescriptor* desc) {
-  return MakeGarbageCollected<MLOperand>(GetContext());
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
 }
 
 MLOperand* MLGraphBuilder::constant(const MLOperandDescriptor* desc,
                                     NotShared<DOMArrayBufferView> buffer_view) {
-  return MakeGarbageCollected<MLOperand>(GetContext());
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
+}
+
+MLOperand* MLGraphBuilder::clamp(const MLOperand* input,
+                                 const MLClampOptions* options) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
+}
+
+MLOperator* MLGraphBuilder::clamp(const MLClampOptions* options) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperator>(this);
+}
+
+MLOperand* MLGraphBuilder::conv2d(const MLOperand* input,
+                                  const MLOperand* filter,
+                                  const MLConv2dOptions* options) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
 }
 
 MLOperand* MLGraphBuilder::add(const MLOperand* a, const MLOperand* b) {
-  return MakeGarbageCollected<MLOperand>(GetContext());
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
 }
 
-MLContext* MLGraphBuilder::GetContext() const {
-  return ml_context_.Get();
+MLOperand* MLGraphBuilder::gemm(const MLOperand* a,
+                                const MLOperand* b,
+                                const MLGemmOptions* options) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
+}
+
+MLOperand* MLGraphBuilder::averagePool2d(const MLOperand* input,
+                                         const MLPool2dOptions* options) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
+}
+
+MLOperand* MLGraphBuilder::reshape(const MLOperand* input,
+                                   const Vector<int32_t>& new_shape) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
+}
+
+MLOperand* MLGraphBuilder::softmax(const MLOperand* input) {
+  // TODO(crbug.com/1273291): Implement this on operating systems to access
+  // hardware acceleration.
+  NOTIMPLEMENTED();
+  return MakeGarbageCollected<MLOperand>(this);
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h
index e541ec58..53c5924 100644
--- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h
@@ -15,12 +15,17 @@
 namespace blink {
 
 class MLContext;
+class MLClampOptions;
+class MLConv2dOptions;
+class MLGemmOptions;
+class MLPool2dOptions;
 class MLOperand;
 class MLOperandDescriptor;
+class MLOperator;
 
 typedef HeapVector<std::pair<String, Member<MLOperand>>> MLNamedOperands;
 
-class MLGraphBuilder : public ScriptWrappable {
+class MLGraphBuilder final : public ScriptWrappable {
   DEFINE_WRAPPERTYPEINFO();
 
  public:
@@ -40,10 +45,25 @@
   MLOperand* constant(const MLOperandDescriptor* desc,
                       NotShared<DOMArrayBufferView> buffer_view);
 
-  MLOperand* add(const MLOperand* a, const MLOperand* b);
+  // The order of operations declaration is the same as spec.
+  MLOperand* clamp(const MLOperand*, const MLClampOptions*);
+  MLOperator* clamp(const MLClampOptions*);
+
+  MLOperand* conv2d(const MLOperand*, const MLOperand*, const MLConv2dOptions*);
+
+  // Element-wise binary operations
+  MLOperand* add(const MLOperand*, const MLOperand*);
+
+  MLOperand* gemm(const MLOperand*, const MLOperand*, const MLGemmOptions*);
+
+  // Pooling operations
+  MLOperand* averagePool2d(const MLOperand*, const MLPool2dOptions*);
+
+  MLOperand* reshape(const MLOperand*, const Vector<int32_t>&);
+
+  MLOperand* softmax(const MLOperand*);
 
  private:
-  MLContext* GetContext() const;
   Member<MLContext> ml_context_;
 };
 
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
index bd9aa02..56e8d40 100644
--- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
@@ -6,6 +6,53 @@
 
 typedef record<DOMString, MLOperand> MLNamedOperands;
 
+enum MLInputOperandLayout { "nchw", "nhwc" };
+
+enum MLConv2dFilterOperandLayout { "oihw", "hwio", "ohwi", "ihwo" };
+
+enum MLAutoPad { "explicit", "same-upper", "same-lower" };
+
+dictionary MLConv2dOptions {
+  sequence<long> padding;
+  sequence<long> strides;
+  sequence<long> dilations;
+  MLAutoPad autoPad = "explicit";
+  long groups = 1;
+  MLInputOperandLayout inputLayout = "nchw";
+  MLConv2dFilterOperandLayout filterLayout = "oihw";
+  MLOperand bias;
+  MLOperator activation;
+};
+
+dictionary MLGemmOptions {
+  MLOperand c;
+  float alpha = 1.0;
+  float beta = 1.0;
+  boolean aTranspose = false;
+  boolean bTranspose = false;
+};
+
+enum MLRoundingType {
+  "floor",
+  "ceil"
+};
+
+dictionary MLPool2dOptions {
+  sequence<long> windowDimensions;
+  sequence<long> padding;
+  sequence<long> strides;
+  sequence<long> dilations;
+  MLAutoPad autoPad = "explicit";
+  MLInputOperandLayout layout = "nchw";
+  MLRoundingType roundingType = "floor";
+  sequence<long> outputSizes;
+};
+
+dictionary MLClampOptions {
+  float minValue;
+  float maxValue;
+};
+
 [
   RuntimeEnabled=MachineLearningNeuralNetwork,
   Exposed=Window
@@ -16,5 +63,22 @@
 
   MLOperand constant(MLOperandDescriptor desc, MLBufferView bufferView);
 
+  MLOperand clamp(MLOperand input, optional MLClampOptions options = {});
+  MLOperator clamp(optional MLClampOptions options = {});
+
+  MLOperand conv2d(MLOperand input, MLOperand filter,
+                   optional MLConv2dOptions options = {});
+
+  // Element-wise binary operations
   MLOperand add(MLOperand a, MLOperand b);
+
+  MLOperand gemm(MLOperand a, MLOperand b, optional MLGemmOptions options = {});
+
+  // Pooling operations
+  MLOperand averagePool2d(MLOperand input,
+                          optional MLPool2dOptions options = {});
+
+  MLOperand reshape(MLOperand input, sequence<long> newShape);
+
+  MLOperand softmax(MLOperand input);
 };
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operand.cc b/third_party/blink/renderer/modules/ml/webnn/ml_operand.cc
index 73a7831..5a6c487 100644
--- a/third_party/blink/renderer/modules/ml/webnn/ml_operand.cc
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_operand.cc
@@ -4,16 +4,17 @@
 
 #include "third_party/blink/renderer/modules/ml/webnn/ml_operand.h"
 
-#include "third_party/blink/renderer/modules/ml/ml_context.h"
+#include "third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h"
 
 namespace blink {
 
-MLOperand::MLOperand(MLContext* context) : ml_context_(context) {}
+MLOperand::MLOperand(MLGraphBuilder* graph_builder)
+    : graph_builder_(graph_builder) {}
 
 MLOperand::~MLOperand() = default;
 
 void MLOperand::Trace(Visitor* visitor) const {
-  visitor->Trace(ml_context_);
+  visitor->Trace(graph_builder_);
   ScriptWrappable::Trace(visitor);
 }
 
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operand.h b/third_party/blink/renderer/modules/ml/webnn/ml_operand.h
index 044ac48e..23c608e 100644
--- a/third_party/blink/renderer/modules/ml/webnn/ml_operand.h
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_operand.h
@@ -11,13 +11,13 @@
 
 namespace blink {
 
-class MLContext;
+class MLGraphBuilder;
 
-class MLOperand : public ScriptWrappable {
+class MLOperand final : public ScriptWrappable {
   DEFINE_WRAPPERTYPEINFO();
 
  public:
-  explicit MLOperand(MLContext* context);
+  explicit MLOperand(MLGraphBuilder* graph_builder);
 
   MLOperand(const MLOperand&) = delete;
   MLOperand& operator=(const MLOperand&) = delete;
@@ -27,7 +27,7 @@
   void Trace(Visitor* visitor) const override;
 
  private:
-  Member<MLContext> ml_context_;
+  Member<MLGraphBuilder> graph_builder_;
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc
new file mode 100644
index 0000000..576138d
--- /dev/null
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc
@@ -0,0 +1,21 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/blink/renderer/modules/ml/webnn/ml_operator.h"
+
+#include "third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h"
+
+namespace blink {
+
+MLOperator::MLOperator(MLGraphBuilder* graph_builder)
+    : graph_builder_(graph_builder) {}
+
+MLOperator::~MLOperator() = default;
+
+void MLOperator::Trace(Visitor* visitor) const {
+  visitor->Trace(graph_builder_);
+  ScriptWrappable::Trace(visitor);
+}
+
+}  // namespace blink
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.h b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h
new file mode 100644
index 0000000..db7e95b1
--- /dev/null
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h
@@ -0,0 +1,35 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_ML_WEBNN_ML_OPERATOR_H_
+#define THIRD_PARTY_BLINK_RENDERER_MODULES_ML_WEBNN_ML_OPERATOR_H_
+
+#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
+#include "third_party/blink/renderer/platform/heap/member.h"
+#include "third_party/blink/renderer/platform/heap/visitor.h"
+
+namespace blink {
+
+class MLGraphBuilder;
+
+class MLOperator final : public ScriptWrappable {
+  DEFINE_WRAPPERTYPEINFO();
+
+ public:
+  explicit MLOperator(MLGraphBuilder* graph_builder);
+
+  MLOperator(const MLOperator&) = delete;
+  MLOperator& operator=(const MLOperator&) = delete;
+
+  ~MLOperator() override;
+
+  void Trace(Visitor* visitor) const override;
+
+ private:
+  Member<MLGraphBuilder> graph_builder_;
+};
+
+}  // namespace blink
+
+#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_ML_WEBNN_ML_OPERATOR_H_
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.idl b/third_party/blink/renderer/modules/ml/webnn/ml_operator.idl
new file mode 100644
index 0000000..65e1994a5e
--- /dev/null
+++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.idl
@@ -0,0 +1,10 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// https://www.w3.org/TR/webnn/
+
+[
+  RuntimeEnabled=MachineLearningNeuralNetwork,
+  Exposed=Window
+] interface MLOperator {};
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/webnn/idlharness.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/webnn/idlharness.https.any-expected.txt
index 59275703..6d784b3 100644
--- a/third_party/blink/web_tests/platform/generic/external/wpt/webnn/idlharness.https.any-expected.txt
+++ b/third_party/blink/web_tests/platform/generic/external/wpt/webnn/idlharness.https.any-expected.txt
@@ -1,5 +1,5 @@
 This is a testharness.js-based test.
-Found 386 tests; 135 PASS, 251 FAIL, 0 TIMEOUT, 0 NOTRUN.
+Found 386 tests; 148 PASS, 238 FAIL, 0 TIMEOUT, 0 NOTRUN.
 FAIL idl_test setup promise_test: Unhandled rejection with value: object "TypeError: Failed to construct 'MLGraphBuilder': parameter 1 is not of type 'MLContext'."
 PASS idl_test validation
 PASS Partial interface MLContext: original interface defined
@@ -147,12 +147,12 @@
 FAIL Stringification of input assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: input is not defined"
 FAIL MLOperand must be primary interface of filter assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: filter is not defined"
 FAIL Stringification of filter assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: filter is not defined"
-FAIL MLOperator interface: existence and properties of interface object assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
-FAIL MLOperator interface object length assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
-FAIL MLOperator interface object name assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
-FAIL MLOperator interface: existence and properties of interface prototype object assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
-FAIL MLOperator interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
-FAIL MLOperator interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "MLOperator" expected property "MLOperator" missing
+PASS MLOperator interface: existence and properties of interface object
+PASS MLOperator interface object length
+PASS MLOperator interface object name
+PASS MLOperator interface: existence and properties of interface prototype object
+PASS MLOperator interface: existence and properties of interface prototype object's "constructor" property
+PASS MLOperator interface: existence and properties of interface prototype object's @@unscopables property
 FAIL MLOperator must be primary interface of relu assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: relu is not defined"
 FAIL Stringification of relu assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: relu is not defined"
 PASS MLGraphBuilder interface: existence and properties of interface object
@@ -166,10 +166,10 @@
 FAIL MLGraphBuilder interface: operation constant(double, optional MLOperandType) assert_equals: property has wrong .length expected 1 but got 2
 PASS MLGraphBuilder interface: member build
 FAIL MLGraphBuilder interface: operation batchNormalization(MLOperand, MLOperand, MLOperand, optional MLBatchNormalizationOptions) assert_own_property: interface prototype object missing non-static operation expected property "batchNormalization" missing
-FAIL MLGraphBuilder interface: operation clamp(MLOperand, optional MLClampOptions) assert_own_property: interface prototype object missing non-static operation expected property "clamp" missing
-FAIL MLGraphBuilder interface: operation clamp(optional MLClampOptions) assert_own_property: interface prototype object missing non-static operation expected property "clamp" missing
+PASS MLGraphBuilder interface: operation clamp(MLOperand, optional MLClampOptions)
+PASS MLGraphBuilder interface: operation clamp(optional MLClampOptions)
 FAIL MLGraphBuilder interface: operation concat(sequence<MLOperand>, long) assert_own_property: interface prototype object missing non-static operation expected property "concat" missing
-FAIL MLGraphBuilder interface: operation conv2d(MLOperand, MLOperand, optional MLConv2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "conv2d" missing
+PASS MLGraphBuilder interface: operation conv2d(MLOperand, MLOperand, optional MLConv2dOptions)
 FAIL MLGraphBuilder interface: operation convTranspose2d(MLOperand, MLOperand, optional MLConvTranspose2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "convTranspose2d" missing
 PASS MLGraphBuilder interface: operation add(MLOperand, MLOperand)
 FAIL MLGraphBuilder interface: operation sub(MLOperand, MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "sub" missing
@@ -189,7 +189,7 @@
 FAIL MLGraphBuilder interface: operation tan(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "tan" missing
 FAIL MLGraphBuilder interface: operation elu(MLOperand, optional MLEluOptions) assert_own_property: interface prototype object missing non-static operation expected property "elu" missing
 FAIL MLGraphBuilder interface: operation elu(optional MLEluOptions) assert_own_property: interface prototype object missing non-static operation expected property "elu" missing
-FAIL MLGraphBuilder interface: operation gemm(MLOperand, MLOperand, optional MLGemmOptions) assert_own_property: interface prototype object missing non-static operation expected property "gemm" missing
+PASS MLGraphBuilder interface: operation gemm(MLOperand, MLOperand, optional MLGemmOptions)
 FAIL MLGraphBuilder interface: operation gru(MLOperand, MLOperand, MLOperand, long, long, optional MLGruOptions) assert_own_property: interface prototype object missing non-static operation expected property "gru" missing
 FAIL MLGraphBuilder interface: operation gruCell(MLOperand, MLOperand, MLOperand, MLOperand, long, optional MLGruCellOptions) assert_own_property: interface prototype object missing non-static operation expected property "gruCell" missing
 FAIL MLGraphBuilder interface: operation hardSigmoid(MLOperand, optional MLHardSigmoidOptions) assert_own_property: interface prototype object missing non-static operation expected property "hardSigmoid" missing
@@ -203,7 +203,7 @@
 FAIL MLGraphBuilder interface: operation linear(MLOperand, optional MLLinearOptions) assert_own_property: interface prototype object missing non-static operation expected property "linear" missing
 FAIL MLGraphBuilder interface: operation linear(optional MLLinearOptions) assert_own_property: interface prototype object missing non-static operation expected property "linear" missing
 FAIL MLGraphBuilder interface: operation pad(MLOperand, MLOperand, optional MLPadOptions) assert_own_property: interface prototype object missing non-static operation expected property "pad" missing
-FAIL MLGraphBuilder interface: operation averagePool2d(MLOperand, optional MLPool2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "averagePool2d" missing
+PASS MLGraphBuilder interface: operation averagePool2d(MLOperand, optional MLPool2dOptions)
 FAIL MLGraphBuilder interface: operation l2Pool2d(MLOperand, optional MLPool2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "l2Pool2d" missing
 FAIL MLGraphBuilder interface: operation maxPool2d(MLOperand, optional MLPool2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "maxPool2d" missing
 FAIL MLGraphBuilder interface: operation reduceL1(MLOperand, optional MLReduceOptions) assert_own_property: interface prototype object missing non-static operation expected property "reduceL1" missing
@@ -219,11 +219,11 @@
 FAIL MLGraphBuilder interface: operation relu(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "relu" missing
 FAIL MLGraphBuilder interface: operation relu() assert_own_property: interface prototype object missing non-static operation expected property "relu" missing
 FAIL MLGraphBuilder interface: operation resample2d(MLOperand, optional MLResample2dOptions) assert_own_property: interface prototype object missing non-static operation expected property "resample2d" missing
-FAIL MLGraphBuilder interface: operation reshape(MLOperand, sequence<long>) assert_own_property: interface prototype object missing non-static operation expected property "reshape" missing
+PASS MLGraphBuilder interface: operation reshape(MLOperand, sequence<long>)
 FAIL MLGraphBuilder interface: operation sigmoid(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "sigmoid" missing
 FAIL MLGraphBuilder interface: operation sigmoid() assert_own_property: interface prototype object missing non-static operation expected property "sigmoid" missing
 FAIL MLGraphBuilder interface: operation slice(MLOperand, sequence<long>, sequence<long>, optional MLSliceOptions) assert_own_property: interface prototype object missing non-static operation expected property "slice" missing
-FAIL MLGraphBuilder interface: operation softmax(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "softmax" missing
+PASS MLGraphBuilder interface: operation softmax(MLOperand)
 FAIL MLGraphBuilder interface: operation softplus(MLOperand, optional MLSoftplusOptions) assert_own_property: interface prototype object missing non-static operation expected property "softplus" missing
 FAIL MLGraphBuilder interface: operation softplus(optional MLSoftplusOptions) assert_own_property: interface prototype object missing non-static operation expected property "softplus" missing
 FAIL MLGraphBuilder interface: operation softsign(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "softsign" missing
diff --git a/third_party/blink/web_tests/platform/generic/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/platform/generic/webexposed/global-interface-listing-expected.txt
index e087c31..7f8b01f 100644
--- a/third_party/blink/web_tests/platform/generic/webexposed/global-interface-listing-expected.txt
+++ b/third_party/blink/web_tests/platform/generic/webexposed/global-interface-listing-expected.txt
@@ -5070,9 +5070,15 @@
 interface MLGraphBuilder
     attribute @@toStringTag
     method add
+    method averagePool2d
+    method clamp
     method constant
     method constructor
+    method conv2d
+    method gemm
     method input
+    method reshape
+    method softmax
 interface MLModelLoader
     attribute @@toStringTag
     method constructor
@@ -5080,6 +5086,9 @@
 interface MLOperand
     attribute @@toStringTag
     method constructor
+interface MLOperator
+    attribute @@toStringTag
+    method constructor
 interface Magnetometer : Sensor
     attribute @@toStringTag
     getter x