gather(indices, elementDtype, elementShape) {
        if (elementDtype !== this.elementDtype) throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
        (0, _tensorUtils.assertShapesMatchAllowUndefinedSize)(this.elementShape, elementShape, "TensorList shape mismatch: ");
        // When indices is greater than the size of the list, indices beyond the
        // size of the list are ignored.
        indices = indices.slice(0, this.size());
        const outputElementShape = (0, _tensorUtils.inferElementShape)(this.elementShape, this.tensors, elementShape);
        if (indices.length === 0) return (0, _tfjsCore.tensor)([], [
            0
        ].concat(outputElementShape));
        return (0, _tfjsCore.tidy)(()=>{
            const tensors = indices.map((i)=>(0, _tfjsCore.reshape)(this.tensors[i], outputElementShape));
            return (0, _tfjsCore.stack)(tensors, 0);
        });
    }
Return selected values in the TensorList as a stacked Tensor. All of
selected values must have been written and their shapes must all match.
@param indices indices of tensors to gather
@param elementDtype output tensor dtype
@param elementShape output tensor element shape