package caisar
A platform for characterizing the safety and robustness of artificial intelligence based software
Install
Dune Dependency
Authors
Maintainers
Sources
caisar-4.0.tbz
sha256=58ba1e38721795b306c860b56aaeba971be586cd55fb96e3ec8af72dd005101b
sha512=f1b3b9899660745598cebe7ecb52a39e9e16dcb7352381ea75a80d2afa988437130c00bf66355991421d4cb3dc06b02c185f7d4bdcc1c86dfcde8084bd01a654
doc/src/caisar.nir/shape.ml.html
Source file shape.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
(**************************************************************************) (* *) (* This file is part of CAISAR. *) (* *) (* Copyright (C) 2025 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* You can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Base type t = int array [@@deriving ord, eq] let to_array = Array.copy let to_array_unsafe x = x let of_array = Array.copy let to_list = Array.to_list let of_list = Array.of_list let rank = Array.length let size t = Array.fold t ~f:( * ) ~init:1 let pp fmt x = Fmt.pf fmt "[%a]" Fmt.(array ~sep:semi int) x let show s = Fmt.str "%a" pp s let get = Array.get let set t k v = let t = Array.copy t in Array.set t k v; t let row_major t a = assert (Array.length t = Array.length a); let r = ref 0 in for i = 0 to Array.length t - 1 do r := (!r * t.(i)) + a.(i) done; !r let unrow_major t i = let r = ref i in let a = Array.create ~len:(Array.length t) 0 in for i = Array.length t - 1 downto 0 do a.(i) <- !r % t.(i); r := !r / t.(i) done; a let remove_row t i = let result = Array.create ~len:(Array.length t - 1) 0 in Array.blit ~src:t ~src_pos:0 ~dst:result ~dst_pos:0 ~len:i; Array.blit ~src:t ~src_pos:(i + 1) ~dst:result ~dst_pos:i ~len:(Array.length t - i - 1); result
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>