code: def set_batch_non_diagonal(array, non_diag_val):
      batch_size, m, n = array.shape
      assert m == n
      rows, cols = np.tril_indices(n, -1)
      array[:, rows, cols] = non_diag_val
  
imports: import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: set_batch_non_diagonal(array, non_diag_val) without return types