Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lnstadrum authored Nov 8, 2023
1 parent 1d8ad5d commit 29072a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

`PixelShuffle`/`PixelUnshuffle` in PyTorch and `depth_to_space`/`space_to_depth` in TensorFlow are very similar, but they are not numerically identical unless the upsampled image contains a single channel. This can be easyly verified by hand: while the tensor dimensions match between the PyTorch and TensorFlow worlds, the output channels do not follow the same order.
`PixelShuffle`/`PixelUnshuffle` in PyTorch and `depth_to_space`/`space_to_depth` in TensorFlow are very similar, but they are not numerically identical unless the upsampled image contains a single channel. This can be easily verified by hand: while the tensor dimensions match between the PyTorch and TensorFlow worlds, the output channels do not follow the same order.

However, in some deployment setups, there might be performance benefits to using the space-to-depth/depth-to-space variant. For example, at the moment of writing, [Android NN API](https://developer.android.com/ndk/guides/neuralnetworks) only supports depth-to-space and space-to-depth.

Expand Down Expand Up @@ -29,4 +29,4 @@ from s2d2s import SpaceToDepth, DepthToSpace
module = SpaceToDepth(2)
y = module(x)
```
```

0 comments on commit 29072a5

Please sign in to comment.