You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cast.rs
    path of file: ./repos/tract/onnx/src/ops
    
    the code of the file until where you have to start completion: use crate::model::{OnnxOpRegister, ParsingContext};
use crate::pb::*;
use tract_hir::internal::*;
use tract_hir::ops::identity::Identity;
use tract_hir::tract_core::ops::element_wise::*;

pub fn register_all_ops(reg: &mut OnnxOpRegister) {
    reg.insert("Cast", cast);
    reg.insert("CastLike", cast_like);
}

fn cast(
    _ctx: &ParsingContext,
    node: &NodeProto,
) -> TractResult<(Box<dyn InferenceOp>, Vec<String>)> {
    let mut to = node.get_attr::<DatumType>("to")?;
    if to == i64::datum_type() {
        to = TDim::datum_type();
    }
    Ok((ElementWiseOp(Box::new(Cast::new(to))).into_hir(), vec![]))
}

#[derive(Debug, Clone, new, Hash)]
pub struct Cast {
    to: DatumType,
}

impl ElementWiseMiniOp for Cast {
    f
    
    fn eval_out_of_place(&self, t: &Tensor) -> TractResult<Tensor> {
        if t.datum_type() == String::datum_type() && self.to == f32::datum_type() {
            unsafe {
                let mut output = Tensor::uninitialized::<f32>(t.shape())?;
                let output_slice = output.as_slice_mut_unchecked();
                let input = t.as_slice_unchecked::<String>();
                for i in 0..input.len() {
                    output_slice[i] = match &*input[i] {
                        "-INF" => -std::f32::INFINITY,
                        "INF" | "+INF" => std::f32::INFINITY,
                        v => v.parse()?,
                    };
                }
                Ok(output)
            }
        } else {
            tract_hir::ops::cast::cast(self.to)
                .eval(tvec!(t.clone().into_tvalue()))
                .map(|mut t| t.remove(0).into_tensor())
        }
    }