// Copyright (c) ONNX Project Contributors // // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include "onnx/proto_utils.h" namespace ONNX_NAMESPACE { namespace nb = nanobind; template bool ParseProtoFromPyBytes(Proto* proto, const nb::bytes& bytes) { // Get the buffer from Python bytes object const auto* buffer = static_cast(bytes.data()); size_t length = bytes.size(); return ParseProtoFromBytes(proto, buffer, length); } } // namespace ONNX_NAMESPACE