tensorflow matrix_band_part function equivalent in pytorch

Viewed 151

I need to create upper triangular masking tensor in pytorch. in tensorflow it's easy using matrix_band_part. is it any pytorch equivalent for this function? it's like numpy triu_indices but I need for tensor, not just matrix.

0 Answers
Related