ocannl icon indicating copy to clipboard operation
ocannl copied to clipboard

Consider incorporating the (runtime) argument's label for tensors generated via `let%op f x = ... in ...`

Open lukstafi opened this issue 2 years ago • 0 comments

The %op extension keeps track of the to-be-tensor's label via ?ident_label. We would need to modify:

  | [%expr fun [%p? pat] -> [%e? body]] ->
      let vbs, body = translate ?ident_label body in
      (vbs, [%expr fun [%p pat] -> [%e body]])

into something like:

  | [%expr fun [%p? pat] -> [%e? body]] ->
      let vbs, body = translate ?ident_label:(combine ident_label pat) body in
      (vbs, [%expr fun [%p pat] -> [%e body]])

where combine would extract the label out of pat, with something like: [%expr [%e pat2expr pat].value.label].

lukstafi avatar Sep 29 '23 15:09 lukstafi