Name Description Size Coverage
required_datatypes_ranks.json 30205 -
utils.js 54952 -
utils_validation.js Given a target `dataType` (typically an operand's declared dtype, which may not be creatable as a graph input), find a dtype in `supportedTypes` (typically the globally-creatable input dtypes) that `MLGraphBuilder.cast()` can convert into `dataType`. The caller creates the operand with the returned dtype and casts it to `dataType`, so the returned dtype is the cast's input and `dataType` is the cast's output. Candidates are restricted to the same numeric category as `dataType` (kIntTypes / kFloatTypes) and to those later in that category's ordering, i.e. wide enough to hold the values `dataType` can represent. Note: `findCompatibleType` in `resources/utils.js` has the cast input and output checks the other way round; that copy still needs the same fix. @param {string} dataType - The dtype the operand must end up with, i.e. the cast's output dtype. @param {string[]} supportedTypes - Candidate dtypes for the cast's input. @param {object} castOpSupportLimits - `context.opSupportLimits().cast`. @return {string|null} A dtype from `supportedTypes` that can be cast to `dataType`, or `null` if there is none / `dataType` is not supported as a cast output. 39166 -