use crate::{arc, define_obj_type, mlc, objc};
define_obj_type!(pub TrainingGraph(mlc::Graph), MLC_TRAINING_GRAPH);
impl TrainingGraph {
#[objc::msg_send(optimizer)]
pub fn optimizer(&self) -> Option<&mlc::Optimizer>;
#[objc::msg_send(deviceMemorySize)]
pub fn device_mem_size(&self) -> usize;
}
#[link(name = "mlc", kind = "static")]
unsafe extern "C" {
static MLC_TRAINING_GRAPH: &'static objc::Class<TrainingGraph>;
}
#[cfg(test)]
mod tests {
use crate::mlc;
#[test]
fn basics() {
let graph = mlc::TrainingGraph::new();
assert!(graph.optimizer().is_none());
assert_eq!(graph.device_mem_size(), 0);
}
}