package caisar
A platform for characterizing the safety and robustness of artificial intelligence based software
Install
Dune Dependency
Authors
Maintainers
Sources
caisar-2.0.tbz
sha256=3d24d2940eed0921acba158a8970687743c401c6a99d0aac8ed6dcfedca1429c
sha512=0b4484c0e080b8ba22722fe9d5665f9015ebf1648ac89c566a978dd54e3e061acb63edd92e078eed310e26f3e8ad2c48f3682a24af2acb1f0633da12f7966a38
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
(**************************************************************************) (* *) (* This file is part of CAISAR. *) (* *) (* Copyright (C) 2024 *) (* 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
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>