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
Currently, the codebase uses helper methods (tfloat, tlong, tint, tbool) to convert numbers / lists / arrays into tensors with the corresponding dtype and send them to the right device. These methods are implemented in gflownet/utils/common.py.
For example, if we want to convert a batch of states into a float tensor, we can do the following:
states = tfloat(states, device=self.device, float_type=self.float)
While this has some advantages, it is rather annoying that we have to explicitly pass device and float_type, which end up making a pretty long line.
I wonder if there is a neat and simple way of changing things so that we could simply do
states = tfloat(states)
The text was updated successfully, but these errors were encountered:
I wonder what is wrong with the long line? I think formatting can take care of that if the issue is only the long line, unless there is some other issue with it.
Another option is to make the tensors to be on device and float early on, and call states = tfloat(states).
Currently, the codebase uses helper methods (
tfloat
,tlong
,tint
,tbool
) to convert numbers / lists / arrays into tensors with the corresponding dtype and send them to the right device. These methods are implemented ingflownet/utils/common.py
.For example, if we want to convert a batch of states into a float tensor, we can do the following:
While this has some advantages, it is rather annoying that we have to explicitly pass
device
andfloat_type
, which end up making a pretty long line.I wonder if there is a neat and simple way of changing things so that we could simply do
The text was updated successfully, but these errors were encountered: