package arrayjit

  1. Overview
  2. Docs

Module Ppx_arrayjit.Ppx_helperSource

Sourceval dim_spec_to_string : [< `Batch_dims of Base.Int.t | `Input_dims of Base.Int.t | `Output_dims of Base.Int.t ] -> Base.String.t
Sourceval ndarray_constant : Ppxlib.expression -> Ppxlib.expression * Astlib.Ast_502.Parsetree.expression Base.List.t * Astlib.Ast_502.Parsetree.expression Base.List.t * Astlib.Ast_502.Parsetree.expression Base.List.t
Sourceval substitute_identifiers_in_einsum_spec : loc:Ppxlib.Location.t -> Base.String.t -> Astlib.Ast_502.Parsetree.expression

Convert a string containing patterns like "identifier*" to an OCaml expression that substitutes the identifiers with their runtime values. Identifiers match the pattern a-z_a-z0-9_* and must directly precede '*'.

Example usage: substitute_identifiers_in_string ~loc "a *x + b * y" generates an expression equivalent to: String.concat "" [Int.to_string a; " *x + "; Int.to_string b; " * y"]

So if a = 2 and b = 3, the result would be "2 *x + 3 * y". Whitespace between identifiers and '*' is preserved.

OCaml

Innovation. Community. Security.