@@ -23,9 +23,7 @@ def __init__(self, sim):
2323 self ._cache : dict [Type [torch .dtype ], TensorRingBuffer ] = {}
2424 self ._cache_slices_by_type : dict [Type ["Sensor" ], slice ] = {}
2525
26- self ._last_cache_cloned_step : int = - 1
2726 self ._last_ground_truth_cache_cloned_step : int = - 1
28- self ._cloned_cache : dict [Type [torch .dtype ], TensorRingBuffer ] = {}
2927 self ._cloned_ground_truth_cache : dict [Type [torch .dtype ], torch .Tensor ] = {}
3028
3129 def create_sensor (self , sensor_options : "SensorOptions" ):
@@ -80,11 +78,7 @@ def build(self):
8078 dtype = sensor_cls ._get_cache_dtype ()
8179 for sensor in sensors :
8280 sensor ._shared_metadata = self ._sensors_metadata [sensor_cls ]
83-
84- cache_slice = slice (sensor ._cache_idx , sensor ._cache_idx + sensor ._cache_size )
85- sensor ._cache = self ._cache [dtype ][cache_slice ]
86- sensor ._ground_truth_cache = self ._ground_truth_cache [dtype ][cache_slice ]
87-
81+ sensor ._cache = self ._cache [dtype ][sensor ._cache_idx : sensor ._cache_idx + sensor ._cache_size ]
8882 sensor .build ()
8983
9084 def step (self ):
@@ -100,13 +94,6 @@ def step(self):
10094 self ._cache [dtype ][cache_slice ],
10195 )
10296
103- def get_cloned_from_cache (self , sensor : "Sensor" ) -> "TensorRingBuffer" :
104- dtype = sensor ._get_cache_dtype ()
105- if self ._last_cache_cloned_step != self ._sim .cur_step_global :
106- self ._last_cache_cloned_step = self ._sim .cur_step_global
107- self ._cloned_cache [dtype ] = self ._cache [dtype ].clone ()
108- return self ._cloned_cache [dtype ][:, sensor ._cache_idx : sensor ._cache_idx + sensor ._cache_size ]
109-
11097 def get_cloned_from_ground_truth_cache (self , sensor : "Sensor" ) -> torch .Tensor :
11198 dtype = sensor ._get_cache_dtype ()
11299 if self ._last_ground_truth_cache_cloned_step != self ._sim .cur_step_global :
0 commit comments