Skip to main content

Module_new

Function Module_new 

Source
pub fn Module_new(
    file_path: &CxxString,
    data_files: &[&str],
    load_mode: ET_ModuleLoadMode,
    event_tracer: UniquePtr<EventTracer>,
    memory_allocator: UniquePtr<ET_MemoryAllocator>,
    temp_allocator: UniquePtr<ET_MemoryAllocator>,
    share_memory_arenas: bool,
) -> UniquePtr<Module> 
Available on crate features module and std only.
Expand description

Constructs an instance by loading a program from a file with specified memory locking behavior.

§Arguments

  • file_path: The path to the ExecuTorch program file to load.
  • data_files: The path to one or more .ptd file/s.
  • load_mode: The loading mode to use.
  • event_tracer: An EventTracer used for tracking and logging events, or null if not needed.
  • share_memory_arenas: When true, all methods loaded by this Module share a single set of memory-planned buffers.