Sparse matrix is basically a tuple with two index and 1 value: (x, y, value). So one workaround I can think of is you index into ll_bern(dri, pi)[x, y] using the index from the sparse observed_d, and just observed the value of observed_d.
Sparse matrix is basically a tuple with two index and 1 value: (x, y, value). So one workaround I can think of is you index into ll_bern(dri, pi)[x, y] using the index from the sparse observed_d, and just observed the value of observed_d.