Skip to content

[Test Mv]mv dataset test #52148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ add_custom_target(paddle_python ALL
set(PADDLE_PYTHON_PACKAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/dist/)

if(WITH_TESTING)
add_subdirectory(paddle/dataset/tests)
add_subdirectory(paddle/fluid/tests)
add_subdirectory(paddle/fluid/contrib/tests)
add_subdirectory(paddle/static/quantization/tests)
Expand Down
1 change: 0 additions & 1 deletion python/paddle/dataset/tests/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(WITH_TESTING)
add_subdirectory(custom_kernel)
# add_subdirectory(custom_op)
# add_subdirectory(custom_runtime)
# add_subdirectory(dataset)
add_subdirectory(dataset)
# add_subdirectory(distributed_passes)
# add_subdirectory(distribution)
# add_subdirectory(dygraph_to_static)
Expand Down
9 changes: 9 additions & 0 deletions test/dataset/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
file(
GLOB TEST_OPS
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")

foreach(src ${TEST_OPS})
py_test(${src} SRCS ${src}.py)
endforeach()
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
Description:
This scipt test image resize,flip and chw.
"""

import sys
import os
import unittest

import numpy as np
Expand All @@ -35,7 +34,9 @@ class Image(unittest.TestCase):

def test_resize_flip_chw(self):
"""resize"""
imgdir = sys.argv[0].replace('test_image.py', 'cat.jpg')
imgdir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'cat.jpg'
)
images = image.load_image(imgdir)
images = image.resize_short(images, 256)
self.assertEqual(256, min(images.shape[:2]))
Expand Down
File renamed without changes.