stack(elementShape, elementDtype, numElements = -1) {
        if (elementDtype !== this.elementDtype) throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
        if (numElements !== -1 && this.tensors.length !== numElements) throw new Error(`Operation expected a list with ${numElements} elements but got a list with ${this.tensors.length} elements.`);
        (0, _tensorUtils.assertShapesMatchAllowUndefinedSize)(elementShape, this.elementShape, "TensorList shape mismatch: ");
        const outputElementShape = (0, _tensorUtils.inferElementShape)(this.elementShape, this.tensors, elementShape);
        return (0, _tfjsCore.tidy)(()=>{
            const reshapedTensors = this.tensors.map((tensor)=>(0, _tfjsCore.reshape)(tensor, outputElementShape));
            return (0, _tfjsCore.stack)(reshapedTensors, 0);
        });
    }
Return a tensor that stacks a list of rank-R tf.Tensors into one rank-(R+1)
tf.Tensor.
@param elementShape shape of each tensor
@param elementDtype data type of each tensor
@param numElements the number of elements to stack