concat(dtype) {
        if (!!dtype && dtype !== this.dtype) throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${dtype}`);
        if (this.size() === 0) return (0, _tfjsCore.tensor)([], [
            0
        ].concat(this.elementShape));
        const indices = [];
        for(let i = 0; i < this.size(); i++)indices.push(i);
        // Collect all the tensors from the tensors array.
        const tensors = this.readMany(indices);
        (0, _tensorUtils.assertShapesMatchAllowUndefinedSize)(this.elementShape, tensors[0].shape, `TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${tensors[0].shape})`);
        return (0, _tfjsCore.concat)(tensors, 0);
    }
Return the values in the TensorArray as a concatenated Tensor.