mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 18:48:51 +00:00

* Generate some zeros tensor in the onnx simple-eval example. * Fix the casting operation. * Support more ops. * Handle reshape. * Concat. * Softmax.
15 lines
347 B
Rust
15 lines
347 B
Rust
use candle::Result;
|
|
use prost::Message;
|
|
|
|
pub mod onnx {
|
|
include!(concat!(env!("OUT_DIR"), "/onnx.rs"));
|
|
}
|
|
|
|
mod eval;
|
|
pub use eval::{dtype, simple_eval};
|
|
|
|
pub fn read_file<P: AsRef<std::path::Path>>(p: P) -> Result<onnx::ModelProto> {
|
|
let buf = std::fs::read(p)?;
|
|
onnx::ModelProto::decode(buf.as_slice()).map_err(candle::Error::wrap)
|
|
}
|