MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / to_torch

Method to_torch

roach/models/ppo_buffer.py:167–169  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

165
166 def _get_samples(self, batch_inds: np.ndarray) -> PpoBufferSamples:
167 def to_torch(x):
168 return th.as_tensor(x).to(self.device)
169 # return th.from_numpy(x.astype(np.float32)).to(self.device)
170
171 obs_dict = {}
172 for k in self.observations.keys():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected