baybe.utils.dataframe.to_tensor¶
- baybe.utils.dataframe.to_tensor(*x: int | float | ndarray | Series | DataFrame)[source]¶
Convert ints, floats, numpy arrays and pandas series/dataframes to tensors.
- Parameters:
*x (
int|float|ndarray|Series|DataFrame) – The int(s)/float(s)/array(s)/series/dataframe(s) to be converted.- Return type:
- Returns:
The provided inputs represented as tensor(s).
If possible, returns views of the original data, otherwise creates copies. The latter will be the case if the input data is not contiguous in memory, not of the configured Torch dtype, or uses negative strides.