0

webnn: add support limits for pool2d operators

This CL adds data type support limits for average_pool2d, l2_pool2d and
max_pool2d.

Bug: 345271830
Change-Id: I049341d41a46b89a5d204bc256c27f2af6028a0f
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/+/5790009
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Lisha Guo <lisha.guo@intel.com>
Cr-Commit-Position: refs/heads/main@{#1345222}
This commit is contained in:
lisa0314
2024-08-22 03:11:15 +00:00
committed by Chromium LUCI CQ
parent fc2175babb
commit 31117b35bb
34 changed files with 501 additions and 71 deletions

@ -676,6 +676,9 @@ ContextProperties GraphBuilderCoreml::GetContextProperties() {
// TODO: crbug.com/338667172 - Consider enhancing the data type support
// to include int32.
/*linear_input=*/DataTypeConstraint::kFloat16To32,
/*average_pool2d_input=*/DataTypeConstraint::kFloat16To32,
/*l2_pool2d_input=*/DataTypeConstraint::kFloat16To32,
/*max_pool2d_input=*/DataTypeConstraint::kFloat16To32,
/*reduce_l1_input=*/kFloatsAndInt32,
/*reduce_l2_input=*/kFloatsAndInt32,
/*reduce_log_sum_input=*/kFloatsAndInt32,
@ -2331,16 +2334,19 @@ base::expected<void, mojom::ErrorPtr> GraphBuilderCoreml::AddOperationForPool2d(
const OperandInfo& input_operand_info =
GetOperandInfo(operation.input_operand_id);
if (!kFloatDataTypes.contains(input_operand_info.mil_data_type)) {
switch (operation.kind) {
case mojom::Pool2d::Kind::kAveragePool2d:
case mojom::Pool2d::Kind::kL2Pool2d:
NOTREACHED() << "Invalid input datatype.";
case mojom::Pool2d::Kind::kMaxPool2d:
return NewNotSupportedError(NotSupportedInputArgumentTypeError(
ops::kMaxPool2d,
MILDataTypeToOperandType(input_operand_info.mil_data_type)));
}
switch (operation.kind) {
case mojom::Pool2d::Kind::kAveragePool2d:
CHECK(context_properties_.data_type_limits.average_pool2d_input.Has(
MILDataTypeToOperandType(input_operand_info.mil_data_type)));
break;
case mojom::Pool2d::Kind::kL2Pool2d:
CHECK(context_properties_.data_type_limits.l2_pool2d_input.Has(
MILDataTypeToOperandType(input_operand_info.mil_data_type)));
break;
case mojom::Pool2d::Kind::kMaxPool2d:
CHECK(context_properties_.data_type_limits.max_pool2d_input.Has(
MILDataTypeToOperandType(input_operand_info.mil_data_type)));
break;
}
if (operation.dilations->height != 1 || operation.dilations->width != 1) {

@ -54,14 +54,14 @@ ContextProperties ContextImplDml::GetProperties(
DML_FEATURE_LEVEL feature_level) {
CHECK_GE(feature_level, DML_FEATURE_LEVEL_4_0);
static constexpr SupportedDataTypes kFloat16To32Ints32{
OperandDataType::kFloat16, OperandDataType::kFloat32,
OperandDataType::kInt32, OperandDataType::kUint32};
static constexpr SupportedDataTypes kFloat16To32Ints8{
OperandDataType::kFloat16, OperandDataType::kFloat32,
OperandDataType::kInt8, OperandDataType::kUint8};
static constexpr SupportedDataTypes kFloat16To32Ints32{
OperandDataType::kFloat16, OperandDataType::kFloat32,
OperandDataType::kInt32, OperandDataType::kUint32};
static constexpr SupportedDataTypes kFloat16To32Ints8To32{
OperandDataType::kFloat16, OperandDataType::kFloat32,
OperandDataType::kInt8, OperandDataType::kUint8,
@ -198,6 +198,15 @@ ContextProperties ContextImplDml::GetProperties(
// https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_activation_linear_operator_desc#tensor-support
/*linear_input=*/DataTypeConstraint::kFloat16To32,
// https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_average_pooling_operator_desc
/*average_pool2d_input=*/DataTypeConstraint::kFloat16To32,
// https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_lp_pooling_operator_desc
/*l2_pool2d_input=*/DataTypeConstraint::kFloat16To32,
// https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_max_pooling_operator_desc
/*max_pool2d_input=*/kFloat16To32Ints8,
// https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_reduce_operator_desc#tensor-support-according-to-function
/*reduce_l1_input=*/DataTypeConstraint::kFloat16To32,
/*reduce_l2_input=*/DataTypeConstraint::kFloat16To32,
@ -295,6 +304,7 @@ ContextProperties ContextImplDml::GetProperties(
properties.data_type_limits.reduce_sum_square_input =
DataTypeConstraint::kFloat16To32Ints32To64;
properties.data_type_limits.where_value = SupportedDataTypes::All();
properties.data_type_limits.max_pool2d_input = SupportedDataTypes::All();
}
if (feature_level >= DML_FEATURE_LEVEL_5_1) {

@ -1920,6 +1920,7 @@ void CreateOperatorNodeForPad(const IdToOperandMap& id_to_operand_map,
}
base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForPool2d(
const ContextProperties& context_properties,
const IdToOperandMap& id_to_operand_map,
const mojom::Pool2dPtr& pool2d,
GraphBuilderDml& graph_builder,
@ -1949,7 +1950,8 @@ base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForPool2d(
const std::string& label = pool2d->label;
switch (pool2d->kind) {
case mojom::Pool2d::Kind::kAveragePool2d: {
CHECK(kDmlFloatDataTypes.contains(input_tensor_desc.GetDataType()));
CHECK(context_properties.data_type_limits.average_pool2d_input.Has(
DmlDataTypeToOperand(input_tensor_desc.GetDataType())));
// TODO(crbug.com/40206287): Work around dilation support for L2 and
// average pooling. According to WebNN spec:
@ -1981,7 +1983,8 @@ base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForPool2d(
break;
}
case mojom::Pool2d::Kind::kL2Pool2d: {
CHECK(kDmlFloatDataTypes.contains(input_tensor_desc.GetDataType()));
CHECK(context_properties.data_type_limits.l2_pool2d_input.Has(
DmlDataTypeToOperand(input_tensor_desc.GetDataType())));
DML_LP_POOLING_OPERATOR_DESC l2_pooling_desc = {
.InputTensor = &input_tensor_desc.GetDMLTensorDesc(),
@ -1998,6 +2001,9 @@ base::expected<void, mojom::ErrorPtr> CreateOperatorNodeForPool2d(
break;
}
case mojom::Pool2d::Kind::kMaxPool2d: {
CHECK(context_properties.data_type_limits.max_pool2d_input.Has(
DmlDataTypeToOperand(input_tensor_desc.GetDataType())));
// If the dilations are { 1, 1 } by default, prefer using
// `DML_MAX_POOLING_OPERATOR_DESC` without dilations supported for best
// compatibility.
@ -5672,8 +5678,8 @@ base::expected<void, mojom::ErrorPtr> GraphImplDml::CreateAndBuildInternal(
}
case Operation::Tag::kPool2d: {
create_operator_result = CreateOperatorNodeForPool2d(
id_to_operand_map, operation->get_pool2d(), graph_builder,
id_to_node_output_map);
context_properties, id_to_operand_map, operation->get_pool2d(),
graph_builder, id_to_node_output_map);
break;
}
case Operation::Tag::kPrelu: {

@ -48,6 +48,9 @@ DataTypeLimits::DataTypeLimits(SupportedDataTypes input,
SupportedDataTypes hard_swish_input,
SupportedDataTypes leaky_relu_input,
SupportedDataTypes linear_input,
SupportedDataTypes average_pool2d_input,
SupportedDataTypes l2_pool2d_input,
SupportedDataTypes max_pool2d_input,
SupportedDataTypes reduce_l1_input,
SupportedDataTypes reduce_l2_input,
SupportedDataTypes reduce_log_sum_input,
@ -112,6 +115,9 @@ DataTypeLimits::DataTypeLimits(SupportedDataTypes input,
hard_swish_input(hard_swish_input),
leaky_relu_input(leaky_relu_input),
linear_input(linear_input),
average_pool2d_input(average_pool2d_input),
l2_pool2d_input(l2_pool2d_input),
max_pool2d_input(max_pool2d_input),
reduce_l1_input(reduce_l1_input),
reduce_l2_input(reduce_l2_input),
reduce_log_sum_input(reduce_log_sum_input),

@ -53,6 +53,9 @@ struct COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) DataTypeLimits {
SupportedDataTypes hard_swish_input,
SupportedDataTypes leaky_relu_input,
SupportedDataTypes linear_input,
SupportedDataTypes average_pool2d_input,
SupportedDataTypes l2_pool2d_input,
SupportedDataTypes max_pool2d_input,
SupportedDataTypes reduce_l1_input,
SupportedDataTypes reduce_l2_input,
SupportedDataTypes reduce_log_sum_input,
@ -128,6 +131,9 @@ struct COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) DataTypeLimits {
SupportedDataTypes hard_swish_input;
SupportedDataTypes leaky_relu_input;
SupportedDataTypes linear_input;
SupportedDataTypes average_pool2d_input;
SupportedDataTypes l2_pool2d_input;
SupportedDataTypes max_pool2d_input;
SupportedDataTypes reduce_l1_input;
SupportedDataTypes reduce_l2_input;
SupportedDataTypes reduce_log_sum_input;
@ -194,6 +200,9 @@ inline bool operator==(const DataTypeLimits& lhs, const DataTypeLimits& rhs) {
lhs.hard_swish_input == rhs.hard_swish_input &&
lhs.leaky_relu_input == rhs.leaky_relu_input &&
lhs.linear_input == rhs.linear_input &&
lhs.average_pool2d_input == rhs.average_pool2d_input &&
lhs.l2_pool2d_input == rhs.l2_pool2d_input &&
lhs.max_pool2d_input == rhs.max_pool2d_input &&
lhs.reduce_l1_input == rhs.reduce_l1_input &&
lhs.reduce_l2_input == rhs.reduce_l2_input &&
lhs.reduce_log_sum_input == rhs.reduce_log_sum_input &&

@ -959,8 +959,10 @@ Pool2dAttributes& Pool2dAttributes::operator=(Pool2dAttributes&& other) =
default;
base::expected<OperandDescriptor, std::string> ValidatePool2dAndInferOutput(
const ContextProperties& context_properties,
const OperandDescriptor& input,
const Pool2dAttributes& attributes) {
const Pool2dAttributes& attributes,
Pool2dKind kind) {
const std::string& label = attributes.label;
// Validate input operand and set its sizes.
if (input.Rank() != 4) {
@ -968,6 +970,23 @@ base::expected<OperandDescriptor, std::string> ValidatePool2dAndInferOutput(
ErrorWithLabel(label, "The input should be a 4-D tensor."));
}
const SupportedDataTypes& data_type_constraint = [&](Pool2dKind kind) {
switch (kind) {
case Pool2dKind::kAverage:
return context_properties.data_type_limits.average_pool2d_input;
case Pool2dKind::kL2:
return context_properties.data_type_limits.l2_pool2d_input;
case Pool2dKind::kMax:
return context_properties.data_type_limits.max_pool2d_input;
}
}(kind);
if (!data_type_constraint.Has(input.data_type())) {
return base::unexpected(
ErrorWithLabel(label, NotSupportedInputArgumentTypeError(
input.data_type(), data_type_constraint)));
}
const std::vector<uint32_t>& input_shape = input.shape();
// The layout option specifies the layout format of the input tensor.
uint32_t input_batches, input_channels, input_height, input_width;

@ -31,6 +31,8 @@ enum class Conv2dFilterOperandLayout { kOihw, kHwio, kOhwi, kIhwo };
// / groups, H is height and W is the width of filter.
enum class ConvTranspose2dFilterOperandLayout { kIohw, kHwoi, kOhwi };
enum class Pool2dKind { kAverage, kL2, kMax };
// Represents the `MLRoundingType` that is used to compute the output shape.
enum class RoundingType { kFloor, kCeil };
@ -38,7 +40,7 @@ enum class RoundingType { kFloor, kCeil };
// direction of the input sequence.
enum class RecurrentNetworkDirection { kForward, kBackward, kBoth };
enum ReduceKind {
enum class ReduceKind {
kL1,
kL2,
kLogSum,
@ -469,8 +471,10 @@ base::expected<OperandDescriptor, std::string> COMPONENT_EXPORT(
// WebIDL here https://www.w3.org/TR/webnn/#api-mlgraphbuilder-pool2d
base::expected<OperandDescriptor, std::string> COMPONENT_EXPORT(
WEBNN_PUBLIC_CPP)
ValidatePool2dAndInferOutput(const OperandDescriptor& input,
const Pool2dAttributes& attributes);
ValidatePool2dAndInferOutput(const ContextProperties& context_properties,
const OperandDescriptor& input,
const Pool2dAttributes& attributes,
Pool2dKind kind);
// Validate and infer output information of 2-D resample operator defined in
// WebIDL here https://www.w3.org/TR/webnn/#api-mlgraphbuilder-resample2d

@ -53,6 +53,9 @@ TEST(ContextPropertiesMojomTraitsTest, Basic) {
webnn::SupportedDataTypes::All(),
webnn::SupportedDataTypes::All(),
{webnn::OperandDataType::kUint64},
{webnn::OperandDataType::kFloat16, webnn::OperandDataType::kFloat32},
{webnn::OperandDataType::kFloat16, webnn::OperandDataType::kFloat32},
webnn::SupportedDataTypes::All(),
{webnn::OperandDataType::kFloat32},
{webnn::OperandDataType::kFloat32},
{webnn::OperandDataType::kFloat32},
@ -80,9 +83,9 @@ TEST(ContextPropertiesMojomTraitsTest, Basic) {
webnn::ContextProperties output(
webnn::InputOperandLayout::kNhwc,
{{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}});
EXPECT_TRUE(

@ -174,6 +174,18 @@ struct StructTraits<webnn::mojom::DataTypeLimitsDataView,
const webnn::DataTypeLimits& data_type_limits) {
return data_type_limits.linear_input;
}
static webnn::SupportedDataTypes average_pool2d_input(
const webnn::DataTypeLimits& data_type_limits) {
return data_type_limits.average_pool2d_input;
}
static webnn::SupportedDataTypes l2_pool2d_input(
const webnn::DataTypeLimits& data_type_limits) {
return data_type_limits.l2_pool2d_input;
}
static webnn::SupportedDataTypes max_pool2d_input(
const webnn::DataTypeLimits& data_type_limits) {
return data_type_limits.max_pool2d_input;
}
static webnn::SupportedDataTypes reduce_l1_input(
const webnn::DataTypeLimits& data_type_limits) {
return data_type_limits.reduce_l1_input;
@ -312,6 +324,9 @@ struct StructTraits<webnn::mojom::DataTypeLimitsDataView,
data.ReadHardSwishInput(&out->hard_swish_input) &&
data.ReadLeakyReluInput(&out->leaky_relu_input) &&
data.ReadLinearInput(&out->linear_input) &&
data.ReadAveragePool2dInput(&out->average_pool2d_input) &&
data.ReadL2Pool2dInput(&out->l2_pool2d_input) &&
data.ReadMaxPool2dInput(&out->max_pool2d_input) &&
data.ReadReduceL1Input(&out->reduce_l1_input) &&
data.ReadReduceL2Input(&out->reduce_l2_input) &&
data.ReadReduceLogSumInput(&out->reduce_log_sum_input) &&

@ -84,6 +84,11 @@ struct DataTypeLimits {
SupportedDataTypes leaky_relu_input;
SupportedDataTypes linear_input;
// Pool2d.
SupportedDataTypes average_pool2d_input;
SupportedDataTypes l2_pool2d_input;
SupportedDataTypes max_pool2d_input;
// Reduction ops.
SupportedDataTypes reduce_l1_input;
SupportedDataTypes reduce_l2_input;

@ -375,6 +375,9 @@ ContextProperties GraphBuilderTflite::GetContextProperties() {
/*leaky_relu_input=*/kFloat32,
// Linear is emulated by mul and add.
/*linear_input=*/kFloat32AndInt32To64,
/*average_pool2d_input=*/kFloat32,
/*l2_pool2d_input=*/{},
/*max_pool2d_input=*/kFloat32,
// ReduceL1 is emulated by abs and reduceSum.
/*reduce_l1_input=*/kFloat32AndInt32,
// ReduceL2 is emulated by pow and reduceSumSquare.
@ -3376,14 +3379,16 @@ auto GraphBuilderTflite::SerializePool2d(const mojom::Pool2d& pool2d)
::tflite::BuiltinOperator operator_code;
switch (pool2d.kind) {
case mojom::Pool2d::Kind::kAveragePool2d:
CHECK(kFloatDataTypes.contains(input_operand.descriptor.data_type()));
CHECK(context_properties_.data_type_limits.average_pool2d_input.Has(
input_operand.descriptor.data_type()));
operator_code = ::tflite::BuiltinOperator_AVERAGE_POOL_2D;
break;
case mojom::Pool2d::Kind::kMaxPool2d:
CHECK(context_properties_.data_type_limits.max_pool2d_input.Has(
input_operand.descriptor.data_type()));
operator_code = ::tflite::BuiltinOperator_MAX_POOL_2D;
break;
case mojom::Pool2d::Kind::kL2Pool2d:
CHECK(kFloatDataTypes.contains(input_operand.descriptor.data_type()));
return base::unexpected("L2Pool2d is not supported in tflite.");
}

@ -189,6 +189,10 @@ ContextProperties WebNNContextImpl::IntersectWithBaseProperties(
DataTypeConstraint::kFloat16To32);
backend_context_properties.data_type_limits.linear_input.RetainAll(
DataTypeConstraint::kFloat16To32);
backend_context_properties.data_type_limits.average_pool2d_input.RetainAll(
DataTypeConstraint::kFloat16To32);
backend_context_properties.data_type_limits.l2_pool2d_input.RetainAll(
DataTypeConstraint::kFloat16To32);
backend_context_properties.data_type_limits.reduce_l1_input.RetainAll(
DataTypeConstraint::kFloat16To32Ints32To64);
backend_context_properties.data_type_limits.reduce_l2_input.RetainAll(

@ -35,6 +35,17 @@ webnn::InputOperandLayout MojoInputOperandLayoutToComponent(
}
}
webnn::Pool2dKind FromMojoPool2dType(mojom::Pool2d::Kind kind) {
switch (kind) {
case mojom::Pool2d::Kind::kAveragePool2d:
return webnn::Pool2dKind::kAverage;
case mojom::Pool2d::Kind::kL2Pool2d:
return webnn::Pool2dKind::kL2;
case mojom::Pool2d::Kind::kMaxPool2d:
return webnn::Pool2dKind::kMax;
}
}
webnn::ReduceKind MojoReduceTypeToComponent(mojom::Reduce::Kind kind) {
switch (kind) {
case mojom::Reduce::Kind::kL1:
@ -1558,20 +1569,13 @@ bool ValidatePool2d(const ContextProperties& context_properties,
return false;
}
if (pool2d.kind == mojom::Pool2d::Kind::kAveragePool2d ||
pool2d.kind == mojom::Pool2d::Kind::kL2Pool2d) {
if (!(DataTypeConstraint::kFloat16To32.Has(
input->descriptor.data_type()))) {
return false;
}
}
if (output->descriptor.Rank() != 4) {
return false;
}
auto validated_output = ValidatePool2dAndInferOutput(
input->descriptor,
ConvertToPool2dAttributes(context_properties, pool2d, output));
context_properties, input->descriptor,
ConvertToPool2dAttributes(context_properties, pool2d, output),
FromMojoPool2dType(pool2d.kind));
if (!validated_output.has_value()) {
return false;
}

@ -482,6 +482,9 @@ ContextProperties GetContextPropertiesForTesting() {
/*hard_swish_input=*/SupportedDataTypes::All(),
/*leaky_relu_input=*/SupportedDataTypes::All(),
/*linear_input=*/SupportedDataTypes::All(),
/*average_pool2d_input=*/SupportedDataTypes::All(),
/*l2_pool2d_input=*/SupportedDataTypes::All(),
/*max_pool2d_input=*/SupportedDataTypes::All(),
/*reduce_l1_input=*/SupportedDataTypes::All(),
/*reduce_l2_input=*/SupportedDataTypes::All(),
/*reduce_log_sum_input=*/SupportedDataTypes::All(),

@ -438,6 +438,29 @@ const MLOpSupportLimits* MLContext::opSupportLimits(ScriptState* script_state) {
SupportedDataTypesToSupportLimits(data_type_limits.linear_input));
op_support_limits->setLinear(linear);
// Pool2d.
MLSingleInputSupportLimits* average_pool2d =
MLSingleInputSupportLimits::Create();
average_pool2d->setInput(
SupportedDataTypesToSupportLimits(data_type_limits.average_pool2d_input));
average_pool2d->setOutput(
SupportedDataTypesToSupportLimits(data_type_limits.average_pool2d_input));
op_support_limits->setAveragePool2d(average_pool2d);
MLSingleInputSupportLimits* l2_pool2d = MLSingleInputSupportLimits::Create();
l2_pool2d->setInput(
SupportedDataTypesToSupportLimits(data_type_limits.l2_pool2d_input));
l2_pool2d->setOutput(
SupportedDataTypesToSupportLimits(data_type_limits.l2_pool2d_input));
op_support_limits->setL2Pool2d(l2_pool2d);
MLSingleInputSupportLimits* max_pool2d = MLSingleInputSupportLimits::Create();
max_pool2d->setInput(
SupportedDataTypesToSupportLimits(data_type_limits.max_pool2d_input));
max_pool2d->setOutput(
SupportedDataTypesToSupportLimits(data_type_limits.max_pool2d_input));
op_support_limits->setMaxPool2d(max_pool2d);
// Reduction ops.
MLSingleInputSupportLimits* reduce_l1 = MLSingleInputSupportLimits::Create();
reduce_l1->setInput(

@ -113,6 +113,11 @@ dictionary MLOpSupportLimits {
MLSingleInputSupportLimits leakyRelu;
MLSingleInputSupportLimits linear;
// Pool2d.
MLSingleInputSupportLimits averagePool2d;
MLSingleInputSupportLimits l2Pool2d;
MLSingleInputSupportLimits maxPool2d;
// Reduction ops.
MLSingleInputSupportLimits reduceL1;
MLSingleInputSupportLimits reduceL2;

@ -149,6 +149,17 @@ webnn::RoundingType BlinkRoundingTypeToComponent(
}
}
webnn::Pool2dKind FromMojoPool2dKind(webnn::mojom::blink::Pool2d::Kind kind) {
switch (kind) {
case webnn::mojom::blink::Pool2d::Kind::kAveragePool2d:
return webnn::Pool2dKind::kAverage;
case webnn::mojom::blink::Pool2d::Kind::kL2Pool2d:
return webnn::Pool2dKind::kL2;
case webnn::mojom::blink::Pool2d::Kind::kMaxPool2d:
return webnn::Pool2dKind::kMax;
}
}
webnn::ReduceKind MojoReduceKindToComponent(
webnn::mojom::blink::Reduce::Kind kind) {
switch (kind) {
@ -696,6 +707,7 @@ MLOperand* BuildReduce(MLGraphBuilder* builder,
MLOperand* BuildPool2d(MLGraphBuilder* builder,
webnn::mojom::blink::Pool2d::Kind kind,
const webnn::ContextProperties& context_properties,
const MLOperand* input,
const MLPool2dOptions* options,
ExceptionState& exception_state) {
@ -708,7 +720,8 @@ MLOperand* BuildPool2d(MLGraphBuilder* builder,
ASSIGN_OR_THROW_AND_RETURN_IF_ERROR(
webnn::OperandDescriptor output_descriptor,
webnn::ValidatePool2dAndInferOutput(
input->Descriptor(), std::move(pool2d_attributes.value())));
context_properties, input->Descriptor(),
std::move(pool2d_attributes.value()), FromMojoPool2dKind(kind)));
// Create pool2d operator and its output operand. Connect the pool2d operator
// to its input and output operands.
@ -1850,7 +1863,8 @@ MLOperand* MLGraphBuilder::averagePool2d(const MLOperand* input,
}
return BuildPool2d(this, webnn::mojom::blink::Pool2d::Kind::kAveragePool2d,
input, options, exception_state);
ml_context_->GetProperties(), input, options,
exception_state);
}
MLOperand* MLGraphBuilder::l2Pool2d(const MLOperand* input,
@ -1868,8 +1882,9 @@ MLOperand* MLGraphBuilder::l2Pool2d(const MLOperand* input,
return nullptr;
}
return BuildPool2d(this, webnn::mojom::blink::Pool2d::Kind::kL2Pool2d, input,
options, exception_state);
return BuildPool2d(this, webnn::mojom::blink::Pool2d::Kind::kL2Pool2d,
ml_context_->GetProperties(), input, options,
exception_state);
}
MLOperand* MLGraphBuilder::maxPool2d(const MLOperand* input,
@ -1878,8 +1893,9 @@ MLOperand* MLGraphBuilder::maxPool2d(const MLOperand* input,
THROW_AND_RETURN_IF_ERROR(ValidateGraphBuilderState(), nullptr);
THROW_AND_RETURN_TYPE_IF_ERROR(ValidateInput(input), nullptr);
return BuildPool2d(this, webnn::mojom::blink::Pool2d::Kind::kMaxPool2d, input,
options, exception_state);
return BuildPool2d(this, webnn::mojom::blink::Pool2d::Kind::kMaxPool2d,
ml_context_->GetProperties(), input, options,
exception_state);
}
MLOperand* MLGraphBuilder::prelu(const MLOperand* input,

@ -642,6 +642,9 @@ class FakeWebNNContextProvider : public blink_mojom::WebNNContextProvider {
/*hard_swish_input=*/webnn::SupportedDataTypes::All(),
/*leaky_relu_input=*/webnn::SupportedDataTypes::All(),
/*linear_input=*/webnn::SupportedDataTypes::All(),
/*average_pool2d_input=*/webnn::SupportedDataTypes::All(),
/*l2_pool2d_input=*/webnn::SupportedDataTypes::All(),
/*max_pool2d_input=*/webnn::SupportedDataTypes::All(),
/*reduce_l1_input=*/webnn::SupportedDataTypes::All(),
/*reduce_l2_input=*/webnn::SupportedDataTypes::All(),
/*reduce_log_sum_input=*/webnn::SupportedDataTypes::All(),

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8

@ -18,33 +18,33 @@ This is a testharness.js-based test.
[FAIL] averagePool2d float32 4D tensor options.dilations with options.strides
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 28.626827239990234 should be close enough to expected 42.940242767333984 by the acceptable 11 ULP distance, but they have 4636433 ULP distance expected true got false
[FAIL] l2Pool2d float32 4D constant tensor all positive default options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all positive options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all negative options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.windowDimensions
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.padding
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.strides
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nchw
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nhwc
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=floor
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations with options.strides
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] maxPool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] maxPool2d float32 4D tensor options.roundingType=ceil

@ -18,33 +18,33 @@ This is a testharness.js-based test.
[FAIL] averagePool2d float32 4D tensor options.dilations with options.strides
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 28.626827239990234 should be close enough to expected 42.940242767333984 by the acceptable 11 ULP distance, but they have 4636433 ULP distance expected true got false
[FAIL] l2Pool2d float32 4D constant tensor all positive default options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all positive options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all negative options
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.windowDimensions
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.padding
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.strides
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nchw
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nhwc
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=floor
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations with options.strides
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': L2Pool2d is not supported in tflite."
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] maxPool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] maxPool2d float32 4D tensor options.roundingType=ceil

@ -0,0 +1,37 @@
This is a testharness.js-based test.
[FAIL] Test pool2d with default options.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with strides and padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides and asymmetric padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="floor".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="ceil".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with explicit outputSizes ignored roundingType
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[3, 3].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[4, 4].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nchw".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nhwc".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int8 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint8 for argument input, must be one of [float32]."
Harness: the test ran to completion.

@ -0,0 +1,37 @@
This is a testharness.js-based test.
[FAIL] Test pool2d with default options.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with strides and padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides and asymmetric padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="floor".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="ceil".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with explicit outputSizes ignored roundingType
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[3, 3].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[4, 4].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nchw".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nhwc".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int8 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint8 for argument input, must be one of [float32]."
Harness: the test ran to completion.

@ -0,0 +1,7 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16, int8, uint8]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32, float16, int8, uint8]."
Harness: the test ran to completion.

@ -0,0 +1,7 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16, int8, uint8]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32, float16, int8, uint8]."
Harness: the test ran to completion.

@ -0,0 +1,55 @@
This is a testharness.js-based test.
[FAIL] averagePool2d float32 4D tensor options.padding
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 41.94932556152344 should be close enough to expected 52.43666076660156 by the acceptable 27 ULP distance, but they have 2749192 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] averagePool2d float32 4D tensor options.roundingType=floor
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.layout=nhwc and options.roundingType=floor
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.layout=nhwc and options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.dilations with options.strides
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 28.626827239990234 should be close enough to expected 42.940242767333984 by the acceptable 11 ULP distance, but they have 4636433 ULP distance expected true got false
[FAIL] l2Pool2d float32 4D constant tensor all positive default options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all positive options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all negative options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.padding
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.strides
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nchw
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nhwc
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=floor
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations with options.strides
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] maxPool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] maxPool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: maxPool2dOutput"
[FAIL] maxPool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: maxPool2dOutput"
Harness: the test ran to completion.

@ -0,0 +1,55 @@
This is a testharness.js-based test.
[FAIL] averagePool2d float32 4D tensor options.padding
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 41.94932556152344 should be close enough to expected 52.43666076660156 by the acceptable 27 ULP distance, but they have 2749192 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] averagePool2d float32 4D tensor options.roundingType=floor
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.layout=nhwc and options.roundingType=floor
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.layout=nhwc and options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: averagePool2dOutput"
[FAIL] averagePool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 36.13502502441406 should be close enough to expected 54.20252990722656 by the acceptable 11 ULP distance, but they have 4736288 ULP distance expected true got false
[FAIL] averagePool2d float32 4D tensor options.dilations with options.strides
assert_true: assert_array_approx_equals_ulp: test averagePool2d float32 actual 28.626827239990234 should be close enough to expected 42.940242767333984 by the acceptable 11 ULP distance, but they have 4636433 ULP distance expected true got false
[FAIL] l2Pool2d float32 4D constant tensor all positive default options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all positive options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor default all negative options
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.padding
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.strides
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nchw
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.layout=nhwc
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=floor
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.outputSizes ignores options.roundingType=ceil
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] l2Pool2d float32 4D tensor options.dilations with options.strides
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] maxPool2d float32 4D tensor options.dilations
promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'build' on 'MLGraphBuilder': Pool2d in tflite doesn't support dilations."
[FAIL] maxPool2d float32 4D tensor options.roundingType=ceil
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: maxPool2dOutput"
[FAIL] maxPool2d float32 4D tensor options.outputSizes ignores options.roundingType=floor
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'compute' on 'MLContext': The output tensor size does not match graph's expectation: maxPool2dOutput"
Harness: the test ran to completion.

@ -0,0 +1,37 @@
This is a testharness.js-based test.
[FAIL] Test pool2d with default options.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with strides and padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides and asymmetric padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="floor".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="ceil".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with explicit outputSizes ignored roundingType
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[3, 3].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[4, 4].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nchw".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nhwc".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int8 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint8 for argument input, must be one of [float32]."
Harness: the test ran to completion.

@ -0,0 +1,37 @@
This is a testharness.js-based test.
[FAIL] Test pool2d with default options.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with windowDimensions
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with strides and padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides and asymmetric padding.
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="floor".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and roundingType="ceil".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] Test pool2d with explicit outputSizes ignored roundingType
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[3, 3].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with strides, padding and outputSizes=[4, 4].
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nchw".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'l2Pool2d' on 'MLGraphBuilder': Unsupported data type float32 for argument input, must be one of []."
[FAIL] Test pool2d with layout="nhwc".
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'averagePool2d' on 'MLGraphBuilder': Unsupported data type float16 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint32 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int8 for argument input, must be one of [float32]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint8
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type uint8 for argument input, must be one of [float32]."
Harness: the test ran to completion.

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8

@ -1,4 +1,6 @@
This is a testharness.js-based test.
[FAIL] [maxPool2d] Test maxPool2d with data type int32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'maxPool2d' on 'MLGraphBuilder': Unsupported data type int32 for argument input, must be one of [float32, float16]."
[FAIL] [maxPool2d] Test maxPool2d with data type uint32
promise_test: Unhandled rejection with value: object "TypeError: Failed to execute 'input' on 'MLGraphBuilder': Unsupported data type uint32 for input operand named 'input', must be one of [float32, float16, int32]."
[FAIL] [maxPool2d] Test maxPool2d with data type int8