Files
你的名字 4c2f5c69a1 chore: update node_modules with new binary files and dependencies
- Add new binary files for nodemon, onnxruntime-web, and xenova/transformers
- Update various JavaScript and TypeScript files in node_modules
- Remove unused files and dependencies
- Add new test fixtures and documentation files
2025-07-18 08:41:48 +08:00

22 lines
826 B
JavaScript

"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseCastAttributes = exports.cast = void 0;
const util_1 = require("../../../util");
const cast = (handler, inputs, to) => {
validateInputs(inputs);
return [handler.cast(inputs[0], to)];
};
exports.cast = cast;
const parseCastAttributes = (node) => util_1.ProtoUtil.tensorDataTypeFromProto(node.attributes.getInt('to'));
exports.parseCastAttributes = parseCastAttributes;
const validateInputs = (inputs) => {
if (!inputs || inputs.length !== 1) {
throw new Error('Cast requires 1 input.');
}
if (inputs[0].type === 'string') {
throw new Error('Invalid input type.');
}
};
//# sourceMappingURL=cast.js.map