Skip to content

Commit d5f8afb

Browse files
authored
Merge branch 'main' into svekars-patch-36
2 parents 20365bf + 08a9bcd commit d5f8afb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.jenkins/post_process_notebooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
# Pattern to search ``` {.python .jupyter-code-cell}
15-
pattern = re.compile(r'(.*?)``` {.python .jupyter-code-cell}\n\n(from IPython.display import display, HTML\nhtml_code = """\n.*?\n"""\ndisplay\(HTML\(html_code\)\))\n```(.*)', re.DOTALL)
15+
pattern = re.compile(r'(.*?)``` {\.python \.jupyter-code-cell}\n(.*?from IPython\.display import display, HTML.*?display\(HTML\(html_code\)\))\n```(.*)', re.DOTALL)
1616

1717

1818
def process_video_cell(notebook_path):

advanced_source/python_custom_ops.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def crop(pic: torch.Tensor, box: Sequence[int]) -> torch.Tensor:
112112
def _(pic, box):
113113
channels = pic.shape[0]
114114
x0, y0, x1, y1 = box
115-
return pic.new_empty(channels, y1 - y0, x1 - x0)
115+
result = pic.new_empty(y1 - y0, x1 - x0, channels).permute(2, 0, 1)
116+
# The result should have the same metadata (shape/strides/``dtype``/device)
117+
# as running the ``crop`` function above.
118+
return result
116119

117120
######################################################################
118121
# After this, ``crop`` now works without graph breaks:

0 commit comments

Comments
 (0)