mlverse / torch

R Interface to Torch
https://torch.mlverse.org
Other
490 stars 64 forks source link

`torch_triu_indices` and `torch_tril_indices` return 0-based index #1169

Open wangwustat opened 4 months ago

wangwustat commented 4 months ago

Dear fellows,

Thanks for your great work. The functions torch_triu_indices and torch_tril_indices return 0-based index in torch 0.12.0.

For example,

torch_triu_indices(2, 2, offset=1)

returns

torch_tensor 0 1 [ CPULongType{2,1} ]