Skip to content

Commit 539f17a

Browse files
authored
Update a1-02-slangpy.md
1 parent d1a49ed commit 539f17a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/user-guide/a1-02-slangpy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ float computeOutputPixel(TensorView<float> input, uint2 pixelLoc)
242242
{
243243
// Skip out of bounds pixels.
244244
if (x < 0 || x >= width) continue;
245-
if (y < 0 || y >= height) continue;
246245

247246
for (int y = pixelLoc.y - 1; y <= pixelLoc.y + 1; y++)
248247
{
248+
if (y < 0 || y >= height) continue;
249249
sumValue += input[x, y];
250250
count++;
251251
}
@@ -322,10 +322,10 @@ float computeOutputPixel(
322322
{
323323
// Skip out of bounds pixels.
324324
if (x < 0 || x >= width) continue;
325-
if (y < 0 || y >= height) continue;
326325

327326
for (int y = pixelLoc.y - 1; y <= pixelLoc.y + 1; y++)
328327
{
328+
if (y < 0 || y >= height) continue;
329329
sumValue += getInputElement(input, inputGradToPropagateTo, uint2(x, y));
330330
count++;
331331
}

0 commit comments

Comments
 (0)