#include "third_party/blink/renderer/modules/ml/webnn/ml_operand.h"
#include <functional>
#include "base/numerics/safe_conversions.h"
#include "base/types/expected_macros.h"
#include "services/webnn/public/cpp/graph_validation_utils.h"
#include "services/webnn/public/cpp/operand_descriptor.h"
#include "third_party/blink/renderer/modules/ml/webnn/ml_constant_operand.h"
#include "third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h"
#include "third_party/blink/renderer/modules/ml/webnn/ml_graph_utils.h"
#include "third_party/blink/renderer/modules/ml/webnn/ml_operator.h"
namespace blink {
base::expected<MLOperand*, String> MLOperand::ValidateAndCreateInput(
MLGraphBuilder* builder,
V8MLOperandDataType::Enum data_type,
Vector<uint32_t> dimensions,
String name) { … }
MLOperand* MLOperand::CreateOutput(MLGraphBuilder* builder,
webnn::OperandDescriptor descriptor,
const MLOperator* ml_operator) { … }
MLOperand::MLOperand(MLGraphBuilder* builder,
webnn::mojom::blink::Operand::Kind kind,
webnn::OperandDescriptor descriptor)
: … { … }
MLOperand::~MLOperand() = default;
MLGraphBuilder* MLOperand::Builder() const { … }
webnn::mojom::blink::Operand::Kind MLOperand::Kind() const { … }
const String& MLOperand::Name() const { … }
const MLOperator* MLOperand::Operator() const { … }
const webnn::OperandDescriptor& MLOperand::Descriptor() const { … }
webnn::OperandDataType MLOperand::DataType() const { … }
const std::vector<uint32_t>& MLOperand::Shape() const { … }
size_t MLOperand::NumberOfElements() const { … }
size_t MLOperand::ByteLength() const { … }
wtf_size_t MLOperand::Rank() const { … }
Vector<uint32_t> MLOperand::shape() const { … }
V8MLOperandDataType MLOperand::dataType() const { … }
MLConstantOperand const* MLOperand::AsConstantOperand() const { … }
void MLOperand::Trace(Visitor* visitor) const { … }
}