package torch

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file torch_toplevel.ml

1
2
3
4
5
6
7
8
9
10
let parse_and_execute str =
  Lexing.from_string str
  |> !Toploop.parse_toplevel_phrase
  |> Toploop.execute_phrase true Format.err_formatter
  |> fun (_ : bool) -> ()
;;

let register_pp str = Printf.sprintf "#install_printer %s;;" str |> parse_and_execute
let register_all_pps () = register_pp "Torch.Tensor.pp"
let () = register_all_pps ()
OCaml

Innovation. Community. Security.