Skip to content

Commit c5a3096

Browse files
committed
Simplified numpy function call, resolves issue #1038
1 parent 30d090b commit c5a3096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/torchvision_tutorial.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Let’s write a ``torch.utils.data.Dataset`` class for this dataset.
145145
num_objs = len(obj_ids)
146146
boxes = []
147147
for i in range(num_objs):
148-
pos = np.where(masks[i])
148+
pos = np.nonzero(masks[i])
149149
xmin = np.min(pos[1])
150150
xmax = np.max(pos[1])
151151
ymin = np.min(pos[0])

0 commit comments

Comments
 (0)