21 Utilities
These are utilities to help with debugging and testing functions written using malt or any of its other entry points.
If a and b are both number?, the check passes if (abs (- a b)) is less than 0.0001.
If a is dual?, the check passes if (check-dual-equal? (ρ a) b) passes.
If b is dual?, the check passes if (check-dual-equal? a (ρ b)) passes.
If a and b are both list? and of the same length, the check passes if (check-dual-equal? ea eb) passes where ea and eb are corresponding members of a and b respectively.
If a and b are both tensor? and of the same "tlen", the check passes if (check-dual-equal? ea eb) passes where ea and eb are corresponding elements of a and b respectively.
If a and b are equal?, the check passes.
Otherwise the check fails.
(check-dual-equal (f arg ...) ans)
(check-dual-equal (∇¹ f arg ...) grads)
parameter
(max-tensor-print-length max-length) → void? max-length : natural?
= 5
parameter
(raw-tensor-printing? print-raw?) → void? print-raw? : boolean?
= #f