chromium/services/webnn/webnn_utils.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/webnn/webnn_utils.h"

#include <set>

#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "services/webnn/public/cpp/webnn_errors.h"
#include "services/webnn/public/mojom/webnn_graph.mojom.h"

namespace webnn {

namespace {

std::string OpKindToString(mojom::Conv2d::Kind kind) {}

std::string OpKindToString(mojom::Pool2d::Kind kind) {}

// Check 1. no duplicate value in `axes`​, 2. values in `axes` ​​are all
// within [0, N - 1], where N is the length of `axes`.
bool ValidateAxes(base::span<const uint32_t> axes) {}

}  // namespace

std::string OpTagToString(mojom::Operation::Tag tag) {}

std::string OpKindToString(mojom::ArgMinMax::Kind kind) {}

std::string OpKindToString(mojom::ElementWiseBinary::Kind kind) {}

std::string OpKindToString(mojom::ElementWiseUnary::Kind kind) {}

std::string OpKindToString(mojom::Reduce::Kind kind) {}

std::string GetOpName(const mojom::Operation& op) {}

std::string NotSupportedOperatorError(const mojom::Operation& op) {}

std::string NotSupportedOperatorError(const mojom::ElementWiseUnary& op) {}

std::string NotSupportedArgumentTypeError(std::string_view op_name,
                                          std::string_view argument_name,
                                          OperandDataType type) {}

std::string NotSupportedInputArgumentTypeError(std::string_view op_name,
                                               OperandDataType type) {}

std::string NotSupportedOptionTypeError(std::string_view op_name,
                                        std::string_view option_name,
                                        OperandDataType type) {}

std::vector<uint32_t> PermuteArray(base::span<const uint32_t> array,
                                   base::span<const uint32_t> permutation) {}

bool IsLogicalElementWiseBinary(mojom::ElementWiseBinary::Kind kind) {}

}  // namespace webnn