#include "services/webnn/public/cpp/operand_descriptor.h"
#include <numeric>
#include "base/numerics/checked_math.h"
#include "base/ranges/algorithm.h"
namespace webnn {
base::expected<OperandDescriptor, std::string> OperandDescriptor::Create(
OperandDataType data_type,
base::span<const uint32_t> shape) { … }
OperandDescriptor OperandDescriptor::UnsafeCreateForTesting(
OperandDataType data_type,
base::span<const uint32_t> shape) { … }
size_t OperandDescriptor::GetBytesPerElement(OperandDataType data_type) { … }
OperandDescriptor::OperandDescriptor(mojo::DefaultConstruct::Tag) { … }
OperandDescriptor::OperandDescriptor(OperandDataType data_type,
std::vector<uint32_t> shape)
: … { … }
OperandDescriptor::OperandDescriptor(const OperandDescriptor&) = default;
OperandDescriptor& OperandDescriptor::operator=(const OperandDescriptor&) =
default;
OperandDescriptor::OperandDescriptor(OperandDescriptor&&) noexcept = default;
OperandDescriptor& OperandDescriptor::operator=(OperandDescriptor&&) noexcept =
default;
OperandDescriptor::~OperandDescriptor() = default;
size_t OperandDescriptor::PackedByteLength() const { … }
size_t OperandDescriptor::NumberOfElements() const { … }
}