PENet_ICRA2021
PENet_ICRA2021 copied to clipboard
question about the implementation of DE-CSPN++
Hi,
When I read the code about the implementation of DE-CSPN++. I notice that during the iteration you continuously update the depth3, depth5 and depth7. However, the depth3, depth5, depth7 are stored in the list without cloning the underlying data. I am wondering if it is incorrect, since the assignment operation in pytorch is only a reference assignment, so the depth stored in the list would also change when the iteration continues.
Thanks for your reply.
Thanks for your interest! I don't think our implementation is incorrect as when I naively test the follow script:
import torch
d3_list = [i for i in range(4)]
depth3 = torch.tensor([30])
for i in range(12):
depth3 = depth3 + 1
if (i == 2):
d3_list[0] = depth3
if (i == 5):
d3_list[1] = depth3
if (i == 8):
d3_list[2] = depth3
if (i == 11):
d3_list[3] = depth3
print(d3_list)
The result is:
[tensor([33]), tensor([36]), tensor([39]), tensor([42])].
That is to say the tensors stored in the list are tensor depth3 at iteration 3, 6, 9, and 12, respectively. And they are not the same although all of them are named as depth3.