Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mindtorch/_apis/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,4 +1236,7 @@ def search_sorted(sorted_sequence, values, sorter, dtype, right):
return legacy.search_sorted(sorted_sequence, values, sorter, dtype, right)

def scatter_nd_update(input, indices, updates):
return legacy.scatter_nd_update(input, indices, updates, True)
return legacy.scatter_nd_update(input, indices, updates, True)

def triu_indices(row, col, offset, dtype):
return legacy.triu_indices(row, col, offset, dtype)
2 changes: 2 additions & 0 deletions mindtorch/_apis/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,3 +1245,5 @@ def fft(input, n=None, dim=-1, norm="backward"):
input = narrow(input, dim, 0, n)
return legacy.fft_with_size(input, input.ndim, False, False, norm, True, ())

def triu_indices(row, col, offset, dtype):
return legacy.triu_indices(row, col, offset, dtype)
3 changes: 3 additions & 0 deletions mindtorch/_apis/npu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,3 +1631,6 @@ def repeat_interleave_int(input, repeats, dim, output_size):

def repeat_interleave_tensor(input, repeats, dim, output_size):
return pyboost.repeat_interleave_tensor_op(input, repeats, dim, output_size)

def triu_indices(row, col, offset, dtype):
return legacy.triu_indices(row, col, offset, dtype)
3 changes: 3 additions & 0 deletions mindtorch/ops/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,8 @@ def triu(input, diagonal=0):
return execute('triu', input, diagonal)

# triu_indices
def triu_indices(row, col, offset=0, *, dtype=mindtorch.long, device='cpu', layout=mindtorch.strided):
return execute('triu_indices', row, col, offset, dtype, device=device)


# unflatten
Expand Down Expand Up @@ -1145,6 +1147,7 @@ def cosine_similarity(x1, x2, dim=1, eps=1e-8):
"stop_gradient",
"tril",
"triu",
"triu_indices",
"unflatten",
"unfold",
"contiguous",
Expand Down