Skip to content
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

[Rust][IRModule] Flesh out IRModule methods #6741

Merged
merged 12 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
jroesch committed Nov 5, 2020
commit b78453474d9a0574db669cece5d35719e173320c
2 changes: 1 addition & 1 deletion rust/tvm-graph-rt/tests/test_wasm32/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ authors = ["TVM Contributors"]
edition = "2018"

[dependencies]
ndarray="0.12"
ndarray = "0.12"
tvm-graph-rt = { path = "../../" }

[build-dependencies]
Expand Down
11 changes: 1 addition & 10 deletions rust/tvm/src/ir/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ use super::function::BaseFunc;
use super::source_map::SourceMap;
use super::{ty::GlobalTypeVar, relay};

<<<<<<< HEAD
=======
use tvm_macros::Object;

// TODO(@jroesch): define type
>>>>>>> WIP
type TypeData = ObjectRef;

#[derive(Error, Debug)]
Expand Down Expand Up @@ -108,16 +103,12 @@ external! {
// Note: we don't expose update here as update is going to be removed.

impl IRModule {
<<<<<<< HEAD
pub fn parse<N, S>(file_name: N, source: S) -> Result<IRModule>
=======
pub fn new<F, T>(funcs: F, types: T) -> Result<IRModule>
where F: IntoIterator<Item=(GlobalVar, BaseFunc)>, T: IntoIterator<Item=(GlobalTypeVar, TypeData)> {
module_new(Map::from_iter(funcs), Map::from_iter(types))
}

pub fn parse<N, S>(file_name: N, source: S) -> IRModule
>>>>>>> WIP
pub fn parse<N, S>(file_name: N, source: S) -> Result<IRModule>
where
N: Into<TVMString>,
S: Into<TVMString>,
Expand Down
1 change: 0 additions & 1 deletion rust/tvm/src/ir/relay/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use super::expr::BaseExprNode;
use super::function::BaseFuncNode;
use super::span::Span;
use super::ty::{Type, TypeNode};
use super::span::Span;

use tvm_macros::Object;
use tvm_rt::NDArray;
Expand Down
10 changes: 5 additions & 5 deletions tests/scripts/task_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ cd tests/test_tvm_dso
cargo run
cd -

# # run wasm32 test
# cd tests/test_wasm32
# cargo build
# wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm
# cd -
# run wasm32 test
cd tests/test_wasm32
cargo build
wasmtime $RUST_DIR/target/wasm32-wasi/debug/test-wasm32.wasm
cd -

# run nn graph test
cd tests/test_nn
Expand Down