def convert(self, data_format: str, data_type=None):
    '\n        Convert data to specified format.\n\n        :param data_format: torch to use Tensors, numpy to use ndarrays\n        :param data_type: optional torch/numpy dtype for data. When `None` is passed, the data type is left unchanged.\n        '
    if (data_format not in {'torch', 'numpy'}):
        raise pyrado.ValueErr(given=data_format, eq_constraint="'torch' or 'numpy'")
    if (self._data_format == data_format):
        return
    self._data_format = data_format
    for dn in self._data_names:
        self.__dict__[dn] = self.__map_tensors((lambda t: to_format(t, data_format, data_type)), self.__dict__[dn])
Convert data to specified format.

:param data_format: torch to use Tensors, numpy to use ndarrays
:param data_type: optional torch/numpy dtype for data. When `None` is passed, the data type is left unchanged.
def convert(self, data_format: str, data_type=None):
    '\n        Convert data to specified format.\n\n        :param data_format: torch to use Tensors, numpy to use ndarrays\n        :param data_type: optional torch/numpy dtype for data. When `None` is passed, the data type is left unchanged.\n        '
    if (data_format not in {'torch', 'numpy'}):
        raise pyrado.ValueErr(given=data_format, eq_constraint="'torch' or 'numpy'")
    if (self._data_format == data_format):
        return
    self._data_format = data_format
    for dn in self._data_names:
        self.__dict__[dn] = self.__map_tensors((lambda t: to_format(t, data_format, data_type)), self.__dict__[dn])