getTensorsForGradient(kernelName, inputs, outputs) {
        const gradConfig = (0, _kernelRegistry.getGradient)(kernelName);
        if (gradConfig != null) {
            const inputsToSave = gradConfig.inputsToSave || [];
            const outputsToSave = gradConfig.outputsToSave || [];
            // If saveAllInputs is true, all inputs will be saved. Otherwise, inputs
            // specified in inputsToSave will be saved.
            let inputTensorsToSave;
            if (gradConfig.saveAllInputs) {
                _util.assert(Array.isArray(inputs), ()=>"saveAllInputs is true, expected inputs to be an array.");
                inputTensorsToSave = Object.keys(inputs).map((key)=>inputs[key]);
            } else inputTensorsToSave = inputsToSave.map((inputName)=>inputs[inputName]);
            const outputTensorsToSave = outputs.filter((_, i)=>outputsToSave[i]);
            return inputTensorsToSave.concat(outputTensorsToSave);
        }
        // We return an empty list rather than throw an error because the kernel we
        // are looking up may not actually be relevant to backproping through the
        // overall function
        //
        // See 'does not error if irrelevant (pruned) ops are missing grads' test
        // in gradients_test.ts for an example.
        return [];
    }
Returns a list of tensors to save for a given gradient calculation.

@param kernelName name of kernel to look up gradient for.
@param inputs a map of input tensors.
@param outputs an array of output tensors from forward mode of kernel.