Hi there,
It seems like when calling add_key function, usually nothing is happening.
add_key is defined as:
`def add_key(base, new, base_name, new_name, device=None):
''' Add new keys to the given input
Args:
base (tensor): inputs
new (tensor): new info for the inputs
base_name (str): name for the input
new_name (str): name for the new info
device (device): pytorch device
'''
if (new is not None) and (isinstance(new, dict)):
if device is not None:
for key in new.keys():
new[key] = new[key].to(device)
base = {base_name: base,
new_name: new}
return base
Hi there, It seems like when calling
add_key
function, usually nothing is happening.add_key
is defined as: `def add_key(base, new, base_name, new_name, device=None): ''' Add new keys to the given inputWhich means that only when
new` is a dictionary, things will happen. But when it's called in the code, for example here: https://github.com/autonomousvision/convolutional_occupancy_networks/blob/f44d413f8d455657a44c24d06163934c69141a09/src/conv_onet/training.py#L79 Are we expecting that data.get will return a dict? Else, the add_key will do nothing.(PS: the documentation of
add_key
saysnew
should be a tensor, but the code does something only whennew
is a dict)Thanks.