From a6ac716b995cbfe31a2549d41c6abb58f4fdce39 Mon Sep 17 00:00:00 2001 From: Dominic Symes Date: Mon, 11 Apr 2022 10:55:16 +0100 Subject: Specify output dimension formulae for tensor ops For each tensor op clarify how the output dimensions of output height (OH) and output width (OW) relate to the input height (IH) and input width (IW). Signed-off-by: Dominic Symes Change-Id: Iad36041f54e439c944cacf08afac5567dd2bad3f --- chapters/pseudocode.adoc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chapters/pseudocode.adoc') diff --git a/chapters/pseudocode.adoc b/chapters/pseudocode.adoc index 238aa33..3f885c7 100644 --- a/chapters/pseudocode.adoc +++ b/chapters/pseudocode.adoc @@ -185,6 +185,13 @@ int idiv(int input1, int input2) { return input1 / input2; // Integer divide that truncates towards zero } +// Integer division that checks input1 is a multiple of input2 + +int idiv_check(int input1, int input2) { + ERROR_IF(input1 % input2 != 0); // input1 must be a multiple of input2 + return input1 / input2; // exact quotient without rounding +} + int length(in_t input) return number of elements in input list -- cgit v1.2.1