You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Volumes/SSD2TBShaanpatiKhan/MovedHomeFolder/sundar/work/pgmuvi/pgmuvi/lightcurve.py:1349: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_new.cpp:248.)
return torch.as_tensor(periods), torch.as_tensor(weights), torch.as_tensor(scales) # noqa: E501
While weights is a list of torch.Tensors, periods and scales are lists of np.ndarrays, which seems to be source of the warning.
To Reproduce
Fitting a 300-element light curve resulted in this warning.
Fix
adding the following lines before the return statement seems to fix things:
periods = np.array(periods)
scales = np.array(scales)
The text was updated successfully, but these errors were encountered:
Describe the bug
While
weights
is a list oftorch.Tensor
s,periods
andscales
are lists ofnp.ndarray
s, which seems to be source of the warning.To Reproduce
Fitting a 300-element light curve resulted in this warning.
Fix
adding the following lines before the
return
statement seems to fix things:The text was updated successfully, but these errors were encountered: