Skip to content

Commit daa98e7

Browse files
authored
Remove pybind dependencies from RaggedArc. (#842)
* Convert py::object and torch::IValue to each other * Remove py::object from RaggedAny * Remove py::object from RaggedArc * Move files to torch directory * remove unused files * Add unit tests * Remove v2 folder * Remove unused code * Remove unused files * Fix review comments & fix github actions * Check Ivalue contains RaggedAny * Minor fixes * Add attributes related unit test for FsaClass * Fix mutable_grad in older pytorch version * Fix github actions * Fix github action PYTHONPATH * Fix github action PYTHONPATH * Link pybind11::embed * import torch first (to fix macos github actions) * try to fix macos ci
1 parent 08198a9 commit daa98e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2065
-1757
lines changed

.github/workflows/build-doc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- name: Build doc
8989
shell: bash
9090
run: |
91-
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
91+
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
9292
echo "PYTHONPATH: $PYTHONPATH"
9393
cd docs
9494
python3 -m pip install -r ./requirements.txt

.github/workflows/run-tests-cpu.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ jobs:
105105
- name: Display Build Information
106106
shell: bash
107107
run: |
108-
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
108+
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
109109
python3 -m k2.version
110110
111111
- name: Run Tests
112112
shell: bash
113113
run: |
114+
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
114115
cd build
115116
ctest --output-on-failure
116117
# default log level is INFO

.github/workflows/run-tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ jobs:
118118
- name: Display Build Information
119119
shell: bash
120120
run: |
121-
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
121+
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
122122
python3 -m k2.version
123123
124124
- name: Run Tests
125125
shell: bash
126126
run: |
127+
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
127128
cd build
128129
ctest --output-on-failure
129130
# default log level is INFO

k2/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
add_subdirectory(csrc)
2-
add_subdirectory(python)
2+
if(K2_USE_PYTORCH)
3+
add_subdirectory(torch)
4+
else()
5+
message(FATAL_ERROR "Please select a framework.")
6+
endif()

k2/python/csrc/k2.cu

-33
This file was deleted.

k2/python/csrc/torch.cu

-52
This file was deleted.

k2/python/csrc/torch/v2/README.md

-2
This file was deleted.

k2/python/csrc/torch/v2/autograd/arc_sort.h

-83
This file was deleted.

k2/python/csrc/torch/v2/autograd/ragged_arc_holder.h

-40
This file was deleted.

k2/python/csrc/torch/v2/fsa.cu

-113
This file was deleted.

0 commit comments

Comments
 (0)