clearAndClose(keepIds) {
        this.tensors.forEach((tensor)=>{
            if (keepIds == null || !keepIds.has(tensor.id)) tensor.dispose();
        });
        this.tensors.length = 0;
        this.idTensor.dispose();
    }
Dispose the tensors and idTensor and clear the tensor list.