INNER CODE UNIT · Rust

into_proto

tensorflow/rust · src/lib.rs:419

    fn into_proto(self) -> protos::types::DataType {
        if let Some(d) = protos::types::DataType::from_i32(self.to_int() as i32) {
            d
        } else {
            // This is unfortunate, but the protobuf crate doesn't support unrecognized enum values.
            panic!("Unable to convert {} to a protobuf DataType", self);
        }
    }

    // We don't use From, because we don't want this to be public API.
    fn from_proto(proto: protos::types::DataType) -> Self {
        Self::from_int(proto.value() as c_uint)
    }
}

////////////////////////

/// Holds error information when communicating with back and forth with `tensorflow`.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…