ONEforALL-S003 / ONE

On-device Neural Engine / q-implant
Other
1 stars 2 forks source link

Test 코드를 실행할 때 경로문제가 있습니다. #10

Open Judgement9882 opened 1 year ago

Judgement9882 commented 1 year ago

draft : #9

./nncc test를 진행했을 때 어떤 경로에서 파일을 실행시키는지 모르겠습니다.

그래서 절대 경로로 다 바꾼것이 문제입니다..

output_circle_generate_test.py 를 실행시키는거라 같은 디렉토리에 있는 gen_test_data.py 도 실행시킬 수 있을줄 알았는데

파일을 자꾸 못찾아서 gen_test_data.py도 절대경로로 입력했습니다.

# To check if there is a test_output directory
output_dir = "/one/compiler/q-implant/tests/test_output"

if os.path.exists(output_dir):
    # Remove directory
    os.system(f"rm -r {output_dir}")

# Generate test qparams
generate_file = "/one/compiler/q-implant/tests/gen_test_data.py"

이런식으로 했는데.. 제 레포만 root 에 one이라는 디렉토리가 있고 그 안에 내용이 들어있어서

모두의 코드에 적용할 수 없을 것 같습니다.

이걸 상대경로로 하는게 맞을지.. 경로가 좀 헷갈립니다.

wnwoghd22 commented 1 year ago

쉘 스크립트로 파이썬을 실행시킬 때 CMAKE_CURRENT_SOURCE_DIR 같은 예약된 변수를 --dir args로 넘겨준다든지 하는 방식이 있을 것 같습니다.

Judgement9882 commented 1 year ago

쉘 스크립트로 파이썬을 실행시킬 때 CMAKE_CURRENT_SOURCE_DIR 같은 예약된 변수를 --dir args로 넘겨준다든지 하는 방식이 있을 것 같습니다.

아 이해했습니다. 한번 시도해볼게요