<commit_before>module H = Helper

let () =
  let data = Bigarray.Genarray.create Bigarray.float32 Bigarray.c_layout [| 3 |] in
  Bigarray.Genarray.set data [| 0 |] 1.;
  Bigarray.Genarray.set data [| 1 |] 2.;
  Bigarray.Genarray.set data [| 2 |] 6.;
  let placeholder = Ops.placeholder ~name:"x" ~type_:Float () in
  let variable = Variable.float [ 3 ] ~init:(Ops_m.cf [ 8.; 0.; 1. ]) in
  let node =
    Ops.sub variable placeholder
    |> Ops.abs
  in
  let sum = Ops_m.reduce_sum node in
  let session = Session.create () in
  let var, sum =
    Session.(run
      session
      ~inputs:[ Input.float placeholder data ]
       (Output.(both (float node) (float sum))))
  in
  H.print_tensors [Tensor.P var; P sum] ~names:[ "var"; "sum" ]<commit_msg>names<commit_after>module H = Helper

let () =
  let data = Bigarray.Genarray.create Bigarray.float32 Bigarray.c_layout [| 3 |] in
  Bigarray.Genarray.set data [| 0 |] 1.;
  Bigarray.Genarray.set data [| 1 |] 2.;
  Bigarray.Genarray.set data [| 2 |] 6.;
  let placeholder = Ops.placeholder ~name:"x" ~type_:Float () in
  let variable = Variable.float [ 3 ] ~init:(Ops_m.cf [ 8.; 0.; 1. ]) in
  let node =
    Ops.sub variable placeholder
    |> Ops.abs
  in
  let sum = Ops_m.reduce_sum node in
  let session = Session.create () in
  let node, sum =
    Session.(run
      session
      ~inputs:[ Input.float placeholder data ]
       (Output.(both (float node) (float sum))))
  in
  H.print_tensors [Tensor.P node; P sum] ~names:[ "node"; "sum" ]
{'fraction_non_alphanumeric': 0.1467645096731154, 'fraction_numerical': 0.01734489659773182, 'mean_word_length': 2.9577836411609497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7611765', 'n_tokens_mistral': 567, 'n_tokens_neox': 528, 'n_words': 154}