gather(indices, dtype) {
        if (!!dtype && dtype !== this.dtype) throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${dtype}`);
        if (!indices) {
            indices = [];
            for(let i = 0; i < this.size(); i++)indices.push(i);
        } else indices = indices.slice(0, this.size());
        if (indices.length === 0) return (0, _tfjsCore.tensor)([], [
            0
        ].concat(this.elementShape));
        // Read all the PersistentTensors into a vector to keep track of
        // their memory.
        const tensors = this.readMany(indices);
        (0, _tensorUtils.assertShapesMatchAllowUndefinedSize)(this.elementShape, tensors[0].shape, "TensorArray shape mismatch: ");
        return (0, _tfjsCore.stack)(tensors, 0);
    }
Return selected values in the TensorArray as a packed Tensor. All of
selected values must have been written and their shapes must all match.
@param [indices] number[] Optional. Taking values in [0, max_value). If the
   TensorArray is not dynamic, max_value=size(). If not specified returns
   all tensors in the original order.
@param [dtype]