Module type Checkpoint.Named
Parameter trees with stable leaf names.
Implementations must ensure that names x has exactly one name per tensor leaf of x, paired with leaves in traversal order (the order iter and map visit them), and that the names are distinct and non-empty. By convention leaves are named after record fields, with nested structures joined by "." (e.g. "encoder.w").
include Nx.Ptree.S
val map : ('a 'b. ('a, 'b) Nx_effect.t -> ('a, 'b) Nx_effect.t) -> t -> tmap f t is t with f applied to every tensor leaf.
val map2 :
('a 'b. ('a, 'b) Nx_effect.t -> ('a, 'b) Nx_effect.t -> ('a, 'b) Nx_effect.t) ->
t ->
t ->
tmap2 f a b is a and b combined leafwise with f.
Raises Invalid_argument if a and b are not structurally equal.
val iter : ('a 'b. ('a, 'b) Nx_effect.t -> unit) -> t -> unititer f t applies f to every tensor leaf of t.
val names : t -> string listnames x is the name of each tensor leaf of x, in traversal order.