Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/configure-…
Browse files Browse the repository at this point in the history
…pages-4
  • Loading branch information
justinchuby authored Dec 11, 2023
2 parents f2cfe2f + 036b647 commit 9c0841c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
path: 'dist/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v3
10 changes: 10 additions & 0 deletions onnxscript/function_libs/torch_lib/ops/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,11 @@ def aten_diagonal(self: TReal, offset: int = 0, dim1: int = 0, dim2: int = 1) ->
# [0,1,2] -> [2,0,1] when dim1=0 and dim2=1
# [0,1,2] -> [1,0,2] when dim1=0 and dim2=2
# [0,1,2] -> [0,1,2] when dim1=1 and dim2=2
if dim1 < 0:
dim1 = dim1 + len(self.shape)
if dim2 < 0:
dim2 = dim2 + len(self.shape)

self_rank = len(self.shape)
perm = list(range(self_rank))
perm.remove(dim1)
Expand Down Expand Up @@ -2514,6 +2519,11 @@ def aten_diagonal_bool(self: BOOL, offset: int = 0, dim1: int = 0, dim2: int = 1
# [0,1,2] -> [2,0,1] when dim1=0 and dim2=1
# [0,1,2] -> [1,0,2] when dim1=0 and dim2=2
# [0,1,2] -> [0,1,2] when dim1=1 and dim2=2
if dim1 < 0:
dim1 = dim1 + len(self.shape)
if dim2 < 0:
dim2 = dim2 + len(self.shape)

self_rank = len(self.shape)
perm = list(range(self_rank))
perm.remove(dim1)
Expand Down

0 comments on commit 9c0841c

Please sign in to comment.