#![allow(clippy::missing_safety_doc)]
pub mod cxx_util {
pub struct RustAny {
#[allow(unused)]
inner: Box<dyn std::any::Any>,
}
impl RustAny {
pub fn new(inner: Box<dyn std::any::Any>) -> Self {
Self { inner }
}
}
}
use cxx_util::RustAny;
#[cxx::bridge]
pub(crate) mod ffi {
extern "Rust" {
#[namespace = "executorch_rs::cxx_util"]
type RustAny;
}
unsafe extern "C++" {
include!("executorch-sys/cpp/executorch_rs/cxx_bridge.hpp");
type ScalarType = crate::ScalarType;
type TensorShapeDynamism = crate::TensorShapeDynamism;
#[namespace = "executorch::aten"]
type Tensor;
#[namespace = "executorch_rs"]
unsafe fn TensorPtr_new(
sizes: UniquePtr<CxxVector<i32>>,
data: *mut u8,
dim_order: UniquePtr<CxxVector<u8>>,
strides: UniquePtr<CxxVector<i32>>,
scalar_type: ScalarType,
dynamism: TensorShapeDynamism,
allocation: Box<RustAny>,
) -> SharedPtr<Tensor>;
#[namespace = "executorch_rs"]
fn TensorPtr_clone(tensor: &Tensor, scalar_type: ScalarType) -> SharedPtr<Tensor>;
}
impl SharedPtr<Tensor> {}
}