MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / tensor

Method tensor

Utility/Extensions/TensorExtension.py:208–221  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206
207 @property
208 def tensor(self) -> torch.Tensor:
209 self.__write_scalar_batch()
210 if self._empty:
211 shape = [_ for _ in self._buffer.shape]
212 shape[self.grow_dim] = 0
213 return torch.zeros(shape, dtype=self._buffer.dtype, device=self._buffer.device)
214
215 if self.q_start < self.q_end:
216 return self._buffer.narrow_copy(self.grow_dim, self.q_start, self.q_end - self.q_start)
217
218 return torch.cat([
219 self._buffer.narrow(self.grow_dim, self.q_start, self.buf_size - self.q_start),
220 self._buffer.narrow(self.grow_dim, 0, self.q_end)
221 ], dim=self.grow_dim)
222
223 def push(self, value: torch.Tensor) -> None:
224 """

Callers 15

MACVO.pyFile · 0.45
flow_lossFunction · 0.45
depth_lossFunction · 0.45
__init__Method · 0.45
__getitem__Method · 0.45
__getitem__Method · 0.45
__getitem__Method · 0.45
__getitem__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

__write_scalar_batchMethod · 0.95

Tested by 1

test_circular_naiveFunction · 0.36