readToGPU(dataId, options = {}) {
        const texData = this.texData.get(dataId);
        const { values, shape, slice, dtype, isPacked, texture } = texData;
        if (dtype === "complex64") throw new Error("Does not support reading texture for complex64 dtype.");
        // The presence of `slice` indicates this tensor is a shallow slice of a
        // different tensor, and is using that original tensor's texture. Run
        // `clone` in order to copy that texture and read from it.
        if (slice != null) {
            let program;
            if (isPacked) program = new (0, _unaryopPackedGpu.UnaryOpPackedProgram)(shape, _unaryopGpu.CLONE);
            else program = new (0, _unaryopGpu.UnaryOpProgram)(shape, _unaryopGpu.CLONE);
            const res = this.runWebGLProgram(program, [
                {
                    dataId,
                    shape,
                    dtype
                }
            ], dtype);
            const gpuResouorce = this.readToGPU(res, options);
            this.disposeIntermediateTensorInfo(res);
            return gpuResouorce;
        }
        if (texture == null) {
            if (values != null) throw new Error("Data is not on GPU but on CPU.");
            else throw new Error("There is no data on GPU or CPU.");
        }
        // Decode the texture so that it is stored densely (using four channels).
        const tmpTarget = this.decode(dataId, options.customTexShape);
        // Make engine track this tensor, so that we can dispose it later.
        const tensorRef = (0, _tfjsCore.engine)().makeTensorFromTensorInfo(tmpTarget);
        const tmpData = this.texData.get(tmpTarget.dataId);
        return Object.assign({
            tensorRef
        }, tmpData.texture);
    }
Read tensor to a new texture that is densely packed for ease of use.
@param dataId The source tensor.
@param options
    customTexShape: Optional. If set, will use the user defined texture
    shape to create the texture.