function getParamValue(paramName, node, tensorMap, context, resourceManager) {
    const inputParam = node.inputParams[paramName];
    if (inputParam && inputParam.inputIndexStart !== undefined) {
        const start = inputParam.inputIndexStart;
        const end = inputParam.inputIndexEnd === 0 ? undefined : inputParam.inputIndexEnd === undefined ? start + 1 : inputParam.inputIndexEnd;
        const shiftedStart = start < 0 ? node.inputNames.length + start : start;
        if (inputParam.type === "tensor") return getTensor(node.inputNames[shiftedStart], tensorMap, context, resourceManager);
        if (inputParam.type === "tensors") {
            // TODO(mattSoulanille): This filters out NoOp nodes during execution, but
            // these should really never be in the execution graph in the first place.
            // They're necessary for ordering the graph, but should not be visible
            // during execution. Perhaps have different sets of children, one for
            // control dependencies and another for real dependencies.
            const inputs = node.inputs.slice(start, end);
            const inputNames = node.inputNames.slice(start, end).filter((_name, index)=>{
                var _a;
                return ((_a = inputs[index]) === null || _a === void 0 ? void 0 : _a.op) !== "NoOp";
            });
            return inputNames.map((name)=>getTensor(name, tensorMap, context, resourceManager));
        }
        const tensor = getTensor(node.inputNames[shiftedStart], tensorMap, context, resourceManager);
        const data = tensor.dataSync();
        return inputParam.type === "number" ? data[0] : (0, _tfjsCore.util).toNestedArray(tensor.shape, data);
    }
    const attrParam = node.attrParams[paramName];
    return attrParam && attrParam.value;
}
Reuse the tensor if it is marked as keep, otherwise clone the tensor to
 avoid disposal. This is important for TensorArray and TensorList ops, since
 internally they use a tensor as the id for TensorArray and TensorList, and
to simplify lookup, they also use Tensor.id as the key to the internal map.
These id tensors have been marked as kept in the backend, we need avoid clone
them in order to create new Tensor.id.
@param tensor