diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-31 16:21:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-31 16:21:33 -0700 |
| commit | 539f17aebf10dc5fabd55f17ae88c52f47a638cd (patch) | |
| tree | 9d063ed9be8722cf733b8931524f88ff02cb2a6f /docs | |
| parent | d1a49ed46f1f3770e110dd66c3db7ef6f7651e7c (diff) | |
Update a1-02-slangpy.md
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/user-guide/a1-02-slangpy.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/user-guide/a1-02-slangpy.md b/docs/user-guide/a1-02-slangpy.md index fff806229..4e7c8d0a4 100644 --- a/docs/user-guide/a1-02-slangpy.md +++ b/docs/user-guide/a1-02-slangpy.md @@ -242,10 +242,10 @@ float computeOutputPixel(TensorView<float> input, uint2 pixelLoc) { // Skip out of bounds pixels. if (x < 0 || x >= width) continue; - if (y < 0 || y >= height) continue; for (int y = pixelLoc.y - 1; y <= pixelLoc.y + 1; y++) { + if (y < 0 || y >= height) continue; sumValue += input[x, y]; count++; } @@ -322,10 +322,10 @@ float computeOutputPixel( { // Skip out of bounds pixels. if (x < 0 || x >= width) continue; - if (y < 0 || y >= height) continue; for (int y = pixelLoc.y - 1; y <= pixelLoc.y + 1; y++) { + if (y < 0 || y >= height) continue; sumValue += getInputElement(input, inputGradToPropagateTo, uint2(x, y)); count++; } |
