Download UnFlow/src/e2eflow/test/ops/downsample.py from doanh25032004/models_animerun: direct link, hf CLI and curl.
- Browser
- Download file 589 Bytes
-
https://huggingface.co/doanh25032004/models_animerun/resolve/main/UnFlow/src/e2eflow/test/ops/downsample.py
- Command line
-
hf download hf://doanh25032004/models_animerun/UnFlow/src/e2eflow/test/ops/downsample.py
-
curl -L -o downsample.py https://huggingface.co/doanh25032004/models_animerun/resolve/main/UnFlow/src/e2eflow/test/ops/downsample.py
589 Bytes
| import tensorflow as tf | |
| import numpy as np | |
| from ... import ops | |
| class DownsampleTest(tf.test.TestCase): | |
| def test_downsample(self): | |
| first = [ | |
| [1, 1, 2, 2], | |
| [0, 0, 2, 2], | |
| [3, 3, 4, 4], | |
| [3, 3, 2, 2]] | |
| second = [[0.5, 2], [3, 3]] | |
| first = np.reshape(first, [1, 4, 4, 1]) | |
| second = np.reshape(second, [1, 2, 2, 1]) | |
| sess = tf.Session() | |
| result = ops.downsample(first, 2) | |
| result = sess.run(result) | |
| self.assertAllClose(second, result) | |
| if __name__ == "__main__": | |
| tf.test.main() | |