Tensors don’t have the items() method (which is a method of e.g. the dict class) and I’m unsure which method you are looking for, as it seems you would like to get a name and tensor from xs (I assume xs should be a dict or any other container?).