<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tensor(self, field_name, tensor_ind):
 """ Returns the tensor for a given field and tensor index. Parameters field_name : str the name of the field to load tensor_index : int the index of the tensor Returns ------- :obj:`Tensor` the desired tensor """

        if tensor_ind == self._tensor_cache_file_num[field_name]:
            return self._tensors[field_name]
        filename = self.generate_tensor_filename(field_name, tensor_ind, compressed=True)
        Tensor.load(filename, compressed=True,
                    prealloc=self._tensors[field_name])
        self._tensor_cache_file_num[field_name] = tensor_ind
        return self._tensors[field_name]