hookeai.utilities.type_conversion.convert_dict_to_float64

convert_dict_to_float64(tensor_dict, is_inplace=True)[source]

Convert all floating point torch tensors in dictionary to torch.float64.

Torch tensors with type torch.float64 or other non-float types are kept unchanged.

Nested dictionaries are processed recursively.

Parameters:
  • tensor_dict (dict) – Dictionary.

  • is_inplace (bool, default=True) – If True, then input dictionary is updated in-place.

Returns:

tensor_dict – Dictionary.

Return type:

dict