Re-exports§
pub use crate::any::Any;pub use crate::any::AnyView;pub use crate::big_int::BigInt;pub use crate::collections::array::Array;pub use crate::collections::list::List;pub use crate::collections::map::Map;pub use crate::collections::shape::Shape;pub use crate::collections::tensor::CPUNDAlloc;pub use crate::collections::tensor::NDAllocator;pub use crate::collections::tensor::Tensor;pub use crate::collections::tensor::TensorView;pub use crate::device::current_stream;pub use crate::device::with_stream;pub use crate::dtype::DLDataTypeExt;pub use crate::error::Error;pub use crate::error::ErrorKind;pub use crate::error::Result;pub use crate::error::ATTRIBUTE_ERROR;pub use crate::error::INDEX_ERROR;pub use crate::error::INTERNAL_ERROR;pub use crate::error::KEY_ERROR;pub use crate::error::OVERFLOW_ERROR;pub use crate::error::RUNTIME_ERROR;pub use crate::error::TYPE_ERROR;pub use crate::error::VALUE_ERROR;pub use crate::error::ZERO_DIVISION_ERROR;pub use crate::extra::dispatch::Dispatcher;pub use crate::extra::module::Module;pub use crate::extra::structural_mutate::structural_map;pub use crate::extra::structural_mutate::structural_mutate;pub use crate::extra::structural_mutate::InplaceMode;pub use crate::extra::structural_mutate::IntoMapper;pub use crate::extra::structural_mutate::IntoMutator;pub use crate::extra::structural_mutate::MapChainLink;pub use crate::extra::structural_mutate::MutationView;pub use crate::extra::structural_mutate::StructuralMutator;pub use crate::extra::structural_mutate::StructuralMutatorBase;pub use crate::extra::structural_mutate::StructuralMutatorObj;pub use crate::extra::structural_mutate::StructuralMutatorView;pub use crate::extra::structural_mutate::StructuralVarRemap;pub use crate::extra::structural_visit::structural_visit;pub use crate::extra::structural_visit::structural_walk;pub use crate::extra::structural_visit::DefRegionKind;pub use crate::extra::structural_visit::IntoVisitor;pub use crate::extra::structural_visit::IntoWalkResult;pub use crate::extra::structural_visit::IntoWalker;pub use crate::extra::structural_visit::StructuralVisitor;pub use crate::extra::structural_visit::StructuralVisitorBase;pub use crate::extra::structural_visit::StructuralVisitorObj;pub use crate::extra::structural_visit::StructuralVisitorView;pub use crate::extra::structural_visit::VisitInterrupt;pub use crate::extra::structural_visit::WalkChainLink;pub use crate::extra::structural_visit::WalkOrder;pub use crate::extra::structural_visit::WalkResult;pub use crate::extra::unchanged::Unchanged;pub use crate::extra::unchanged::UnchangedOr;pub use crate::function::Function;pub use crate::object::ObjectRefCast;pub use crate::object::Object;pub use crate::object::ObjectArc;pub use crate::object::ObjectCore;pub use crate::object::ObjectCoreWithExtraItems;pub use crate::object::ObjectIdentity;pub use crate::object::ObjectRefCore;pub use crate::optional::Optional;pub use crate::optional::OptionalCompatible;pub use crate::reflection::get_type_attr;pub use crate::reflection::FieldFlags;pub use crate::reflection::FieldGetter;pub use crate::reflection::ObjectDef;pub use crate::reflection::SEqHashKind;pub use crate::reflection::ShallowCopy;pub use crate::reflection::TypeAttrColumn;pub use crate::reflection::UnsafeInit;pub use crate::rvalue_ref::RValueRef;pub use crate::static_init::run_static_init_blocks;pub use crate::string::Bytes;pub use crate::string::String;pub use crate::type_traits::AnyCompatible;pub use tvm_ffi_sys;
Modules§
- Integers with inline
i64storage and arbitrary-precision arithmetic. - In-place mirror of C++
ffi::Optional<T>for non-object-pointerT(include/tvm/ffi/optional.h). - Safe access to object reflection metadata.
- Move-aware object arguments compatible with C++
ffi::RValueRef<T>. - Static init blocks: code that runs when the program or library that holds it loads, as a C++
TVM_FFI_STATIC_INIT_BLOCKdoes. The blocks of a program or library are gathered at link time, wherever in it they are, and a constructor runs them when it loads. Once Python loads a library built on this crate, by any means, it sees what the blocks registered, as it sees the registrations of a C++ library. A block that several libraries of a process have, as each links its own copy of a crate they share, runs once. Seestatic_init_block!.
Macros§
- Attach a context to a result if it is error
- Create a new error with file/line info attached
- Resolves a registered global
Functionby name and caches it for the lifetime of the process (lock-free after the first lookup). Each call site gets its own cache and the macro evaluates to a&'static Function. Panics — naming the function — if it is not registered. - Check the return code of the safe call
- Define the reference to an object type, as C++
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLEdoes:def_object_ref!(TypeName, ParentType, ObjectName). - Create a new error with file/line info attached
- Macro gto get the name of the function
- Macro to implement ArgIntoRef for a list of types
- Macro to implement IntoArgHolder for a list of types
- Implement zero-copy conversions from a derived object reference to one of its base object-reference types.
- Macro to implement
TryFrom<AnyView>andTryFrom<Any>for a list of types - Macro to implement
TryFrom<AnyView>andTryFrom<Any>for generic types likeOption<T>
- Match payloads in
Any,AnyView, object references orMutationView. - Run code when the program or library that holds it loads, as a C++
TVM_FFI_STATIC_INIT_BLOCKdoes. The body is the body of a function that returnsResult<()>: it registers what the library defines, such as global functions, and stops at its first error, which?returns. A body whose statements all end in;returnsOk(()); one that ends in an expression returns it, aResult<()>. - Macro to export a typed function as a C symbol that follows the tvm-ffi ABI
- Macro to export the doc string of a function exported with
tvm_ffi_dll_export_typed_func!, as C++TVM_FFI_DLL_EXPORT_TYPED_FUNC_DOCdoes
Structs§
- DLPack data type struct
- TVM FFI Any value - a union type that can hold various data types
Enums§
- DLPack data type code enum
- The index type of the FFI objects
Type Aliases§
- The type of the stream handle.
Attribute Macros§
- Generate source-ordered runtime type dispatch from
prefix_*handlers. - Define an object type in Rust from its object struct, as Python’s
py_classdoes: the type registers its key with the reflection of every field, so that C++ structural equality and hashing,repr, deep copy and Python see the fields.