Skip to content

Commit

Permalink
bump tract compatibility (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson authored Oct 31, 2024
1 parent a1a4317 commit 9c7e042
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 65 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
- Upgrade to compatibility with tract 0.21.7 and above.

## [0.6.1] - 2024-10-31
- Upgrade `time` to solve incompatibility with Rust 1.80.0
- Add upper bound for tract at 0.21.6 due to breaking upstream change
Expand Down
114 changes: 57 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exclude = [ "benchmarks/perf-test" ]
resolver = "2"

[workspace.dependencies]
tract-core = { version = "0.21,<0.21.6" }
tract-hir = { version = "0.21,<0.21.6" }
tract-nnef = { version = "0.21,<0.21.6" }
tract-onnx = { version = "0.21,<0.21.6" }
tract-core = { version = "0.21" }
tract-hir = { version = "0.21" }
tract-nnef = { version = "0.21" }
tract-onnx = { version = "0.21" }
6 changes: 3 additions & 3 deletions crates/cervo-core/src/inferer/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(super) fn build_symbolic_model(
inputs: &[(String, Vec<usize>)],
) -> TractResult<(Symbol, TypedModel)> {
model.set_output_fact(0, Default::default())?;
let symbol = model.symbol_table.sym("N");
let symbol = model.symbols.sym("N");
for (idx, (_name, shape)) in inputs.iter().enumerate() {
let mut full_shape = tvec!(symbol.to_dim());

Expand Down Expand Up @@ -48,14 +48,14 @@ pub(super) fn build_model<D: ToDim>(

pub(super) fn build_symbolic_typed(model: &mut TypedModel) -> TractResult<Symbol> {
model.declutter()?;
Ok(model.symbol_table.sym("N"))
Ok(model.symbols.sym("N"))
}

pub(super) fn build_typed<D: ToDim>(
model: TypedModel,
batch_dim: D,
) -> TractResult<TypedSimplePlan<TypedModel>> {
let symbol = model.symbol_table.sym("N");
let symbol = model.symbols.sym("N");
let model = model.concretize_dims(
&SymbolValues::default().with(&symbol, batch_dim.to_dim().to_i64().unwrap()),
)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/cervo-onnx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn to_nnef(reader: &mut dyn Read, batch_size: Option<usize>) -> Result<Vec<u
let mut model = model_for_reader(reader)?;

model.set_output_fact(0, Default::default())?;
let symbol = model.symbol_table.sym("N");
let symbol = model.symbols.sym("N");
let input_outlets = model.input_outlets()?.to_vec();

let batch = batch_size
Expand Down

0 comments on commit 9c7e042

Please sign in to comment.