Skip to content

Commit 73002e4

Browse files
hawkinspcopybara-github
authored andcommitted
[NumPy] Fix uses of the np.stack() family of functions under NumPy 1.25.
NumPy 1.25 release notes: https://github.com/numpy/numpy/releases/tag/v1.25.0 Per the release notes, in NumPy 1.25: A sequence must now be passed into the stacking family of functions (stack, vstack, hstack, dstack and column_stack). (gh-23019) This change fixes test failures where a non-sequence was passed to a stack function. The most common fix is to convert the input to a list explicitly before passing it to any stacking functions. PiperOrigin-RevId: 542831919 Change-Id: I69cc25da897098fa11b6299145ab06c0eb37ad96
1 parent ccbaf91 commit 73002e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tutorial.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
"box_mat = physics.named.data.geom_xmat['red_box'].reshape(3, 3)\n",
472472
"box_size = physics.named.model.geom_size['red_box']\n",
473473
"offsets = np.array([-1, 1]) * box_size[:, None]\n",
474-
"xyz_local = np.stack(itertools.product(*offsets)).T\n",
474+
"xyz_local = np.stack(list(itertools.product(*offsets))).T\n",
475475
"xyz_global = box_pos[:, None] + box_mat @ xyz_local\n",
476476
"\n",
477477
"# Camera matrices multiply homogenous [x, y, z, 1] vectors.\n",

0 commit comments

Comments
 (0)