Skip to content

Commit

Permalink
Remove pybind dependencies from RaggedArc. (#842)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pkufool committed Oct 27, 2021
1 parent 08198a9 commit daa98e7
Show file tree
Hide file tree
Showing 75 changed files with 2,065 additions and 1,757 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Build doc
shell: bash
run: |
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
echo "PYTHONPATH: $PYTHONPATH"
cd docs
python3 -m pip install -r ./requirements.txt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-tests-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ jobs:
- name: Display Build Information
shell: bash
run: |
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
python3 -m k2.version
- name: Run Tests
shell: bash
run: |
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
cd build
ctest --output-on-failure
# default log level is INFO
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ jobs:
- name: Display Build Information
shell: bash
run: |
export PYTHONPATH=$PWD/k2/python:$PWD/build/lib:$PYTHONPATH
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
python3 -m k2.version
- name: Run Tests
shell: bash
run: |
export PYTHONPATH=$PWD/k2/torch/python:$PWD/build/lib:$PYTHONPATH
cd build
ctest --output-on-failure
# default log level is INFO
Expand Down
6 changes: 5 additions & 1 deletion k2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
add_subdirectory(csrc)
add_subdirectory(python)
if(K2_USE_PYTORCH)
add_subdirectory(torch)
else()
message(FATAL_ERROR "Please select a framework.")
endif()
33 changes: 0 additions & 33 deletions k2/python/csrc/k2.cu

This file was deleted.

52 changes: 0 additions & 52 deletions k2/python/csrc/torch.cu

This file was deleted.

2 changes: 0 additions & 2 deletions k2/python/csrc/torch/v2/README.md

This file was deleted.

83 changes: 0 additions & 83 deletions k2/python/csrc/torch/v2/autograd/arc_sort.h

This file was deleted.

40 changes: 0 additions & 40 deletions k2/python/csrc/torch/v2/autograd/ragged_arc_holder.h

This file was deleted.

113 changes: 0 additions & 113 deletions k2/python/csrc/torch/v2/fsa.cu

This file was deleted.

Loading

0 comments on commit daa98e7

Please sign in to comment.