tfep.utils.misc.energies_array_to_tensor
- tfep.utils.misc.energies_array_to_tensor(energies, energy_unit=None, dtype=None)[source]
Helper function to convert the a batch of energies from numpy array to PyTorch tensor.
- Parameters:
energies (pint.Quantity) – The energies with shape
(batch_size,)with units.energy_unit (pint.Unit, optional) – The units of energy used in the returned energies. If
None, no conversion is performed, and the energy will be in the same units as the input.dtype (type, optional) – The
torchdata type to be used for the returnedTensor.
- Returns:
energies – The energies with shape
(batch_size,)as a unitlessTensorin units ofenergy_unit.- Return type:
torch.Tensor