Fluent Api for Burn Contract and Test Assertions
This crate provides a fluent api for contract and test assertions for the Burn framework.
use assert_tensor;
let tensor: = new;
assert_tensor
.has_named_dims;
// Panics:
// "Expected tensor to have dimensions [('N', 10), ('C', 3), ('H', 32), ('W', 32)] but got [(10, 3, 32, 17)]"
Assertions
The following assertions are available:
'.has_dims()'
'.has_named_dims()'
'.unpacks_shape()'
Testing API
The "testing" feature enables the testing api; which provides expensive methods for testing tensor contents.
To ensure that the testing api is not used in production, the testing api is only available when the "testing" feature is enabled.
To enable the "testing" feature only for testing, add the following to your Cargo.toml:
[]
= $VERSION
[]
= { = $VERSION, features = ["testing"] }
Change Log
0.3.0
- Bump burn dep to 0.17.0
0.2.1
- Reduce over-broad burn feature deps.
- Clean up pattern formatting.
0.2.0
Added assert_tensor(&tensor).unpacks_shape(...) assertion.
0.1.0
Initial release.