resize(size) {
        if (size < 0) throw new Error(`TensorListResize expects size to be non-negative. Got: ${size}`);
        if (this.maxNumElements !== -1 && size > this.maxNumElements) throw new Error(`TensorListResize input size ${size} is greater maxNumElement ${this.maxNumElements}.`);
        const destTensorList = new TensorList([], this.elementShape, this.elementDtype, this.maxNumElements);
        destTensorList.tensors.length = size;
        for(let i = 0; i < Math.min(this.tensors.length, size); ++i)destTensorList.tensors[i] = this.tensors[i];
        return destTensorList;
    }
Update the size of the list.
@param size the new size of the list.