#include <treelite_importer.hpp>
Public Member Functions | |
auto | get_node_count (treelite::Model const &tl_model) |
auto | get_offsets (treelite::Model const &tl_model) |
auto | num_trees (treelite::Model const &tl_model) |
auto | get_tree_sizes (treelite::Model const &tl_model) |
auto | get_num_class (treelite::Model const &tl_model) |
auto | get_num_feature (treelite::Model const &tl_model) |
auto | get_max_num_categories (treelite::Model const &tl_model) |
auto | get_num_categorical_nodes (treelite::Model const &tl_model) |
auto | get_num_leaf_vector_nodes (treelite::Model const &tl_model) |
auto | get_average_factor (treelite::Model const &tl_model) |
auto | get_bias (treelite::Model const &tl_model) |
auto | get_postproc_params (treelite::Model const &tl_model) |
auto | uses_double_thresholds (treelite::Model const &tl_model) |
auto | uses_double_outputs (treelite::Model const &tl_model) |
auto | uses_integer_outputs (treelite::Model const &tl_model) |
template<index_type variant_index> | |
auto | import_to_specific_variant (index_type target_variant_index, treelite::Model const &tl_model, index_type num_class, index_type num_feature, index_type max_num_categories, std::vector< index_type > const &offsets, index_type align_bytes=index_type{}, raft_proto::device_type mem_type=raft_proto::device_type::cpu, int device=0, raft_proto::cuda_stream stream=raft_proto::cuda_stream{}) |
auto | import (treelite::Model const &tl_model, index_type align_bytes=index_type{}, std::optional< bool > use_double_precision=std::nullopt, raft_proto::device_type dev_type=raft_proto::device_type::cpu, int device=0, raft_proto::cuda_stream stream=raft_proto::cuda_stream{}) |
Static Public Attributes | |
static constexpr auto const | traversal_order |
Struct used to import a model from Treelite to FIL
layout | The in-memory layout for nodes to be loaded into FIL |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Import a treelite model to FIL
Load a model from Treelite to a FIL forest_model. The model will be inspected to determine the correct underlying decision_forest variant to use within the forest_model object.
tl_model | The Treelite Model to load |
align_bytes | If non-zero, ensure that each tree is stored in a multiple of this value of bytes by padding with empty nodes. This can be useful for increasing the likelihood that successive reads will take place within a single cache line. On GPU, a value of 128 can be used for this purpose. On CPU, a value of either 0 or 64 typically produces optimal performance. |
use_double_precision | Whether or not to use 64 bit floats for model evaluation and 64 bit ints for applicable indexing |
dev_type | Which device type to use for inference (CPU or GPU) |
device | For GPU execution, the device id for the device on which this model is to be loaded |
stream | The CUDA stream to use for loading this model (can be omitted for CPU). |
|
inline |
Assuming that the correct decision_forest variant has been identified, import to that variant
|
inline |
|
inline |
|
inline |
|
inline |
|
staticconstexpr |