pub struct ImplFn {Show 14 fields
pub type_name: String,
pub fn_name: String,
pub trait_name: Option<String>,
pub module_path: String,
pub qualified_type_name: String,
pub qualified_name: String,
pub visibility: String,
pub cfg_predicates: Vec<String>,
pub params: Vec<String>,
pub param_types: Vec<String>,
pub return_type: String,
pub vb_params: Vec<usize>,
pub block: Block,
pub span: SrcSpan,
}Expand description
An inherent method on a concrete type.
Fields§
§type_name: String§fn_name: String§trait_name: Option<String>Implemented trait for trait methods (for example candle_core::Module).
None denotes an inherent method.
module_path: StringRust module containing the definition ("" means the crate root).
qualified_type_name: StringQualified owning type for methods. Empty for free functions.
qualified_name: StringFully-qualified function identity.
visibility: StringSource spelling of the visibility. Private items use the empty string.
cfg_predicates: Vec<String>#[cfg(...)] predicates inherited from modules/impls and attached to this function.
params: Vec<String>Parameter names in order; used to find which argument is the VarBuilder.
param_types: Vec<String>Parameter type source text in the same order as params.
Receivers are represented by their source spelling (self, &self, etc.).
return_type: StringExplicit return type source text, or () when omitted.
vb_params: Vec<usize>Indices of every parameter whose type mentions VarBuilder.
Plural because models routinely take more than one: a constructor may take a frozen
base_vb (mmapped weights) and a trainable train_vb (a VarMap). Which
builder a tensor came from is the frozen/trainable distinction, so collapsing them
would discard the thing the gradient analysis will need most.
block: Block§span: SrcSpan