Module Ptree.Dict
type fields = (string * t) listThe type for dict fields.
fields_exn ?ctx t is t's fields.
Raises Invalid_argument if t is not Dict _. The optional ctx is prefixed to the error message.
find name fields is Some v if name is bound in fields, and None otherwise.
find_exn ?ctx name fields is name's value in fields.
Raises Invalid_argument if name is missing. The optional ctx is prefixed to the error message.
val get_tensor_exn :
fields ->
name:string ->
('a, 'l) Nx_core.Dtype.t ->
('a, 'l) Nx.tget_tensor_exn fields ~name dtype is the typed tensor in fields under name.
Raises Invalid_argument if name is missing, name is not a tensor, or the tensor dtype differs from dtype.