Skip to content

Commit 5cd9283

Browse files
committed
allocate memory on batch generation (#126)
1 parent 552d3fb commit 5cd9283

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roboreg/util/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def generate_ht_optical(
6464
) -> torch.Tensor:
6565
ht_optical = torch.zeros(4, 4, dtype=dtype, device=device)
6666
if batch_size is not None:
67-
ht_optical = ht_optical.unsqueeze(0).expand(batch_size, -1, -1)
67+
ht_optical = ht_optical.unsqueeze(0).repeat(batch_size, 1, 1)
6868
ht_optical[..., 0, 2] = (
6969
1.0 # OpenCV-oriented optical frame, in quaternions: [0.5, -0.5, 0.5, -0.5] (w, x, y, z)
7070
)

0 commit comments

Comments
 (0)