clone(x) {
        const y = ENGINE.runKernel((0, _kernelNames.Identity), {
            x
        });
        const inputs = {
            x
        };
        const grad = (dy)=>({
                x: ()=>{
                    const dtype = "float32";
                    const gradInputs = {
                        x: dy
                    };
                    const attrs = {
                        dtype
                    };
                    return ENGINE.runKernel((0, _kernelNames.Cast), gradInputs, // tslint:disable-next-line: no-unnecessary-type-assertion
                    attrs);
                }
            });
        const saved = [];
        this.addTapeNode(this.state.activeScope.name, inputs, [
            y
        ], grad, saved, {});
        return y;
    }
This method is called instead of the public-facing tensor.clone() when
saving a tensor for backwards pass. It makes sure to add the clone
operation to the tape regardless of being called inside a kernel
execution.