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: mod.rs
    path of file: ./repos/neuronika/neuronika-variable/src/node/nll
    
    the code of the file until where you have to start completion: use std::rc::Rc;

use ndarray::{arr0, Array, Axis, Dimension, Ix0, RemoveAxis, Zip};

use crate::{
    autograd::{Backward, Forward},
    gradient::Gradient,
    utils::Shared,
    Reduction,
};

#[allow(clippy::upper_case_acronyms)]
pub(crate) struct NegativeLogLikelihood<D>
where
    D: Dimension + RemoveAxis,
{
    input_data: Shared<Array<f32, D>>,
    target_data: Shared<Array<f32, D::Smaller>>,
    data: Shared<Array<f32, Ix
    
    fn backward(&self) {
        let mut input_gradient = self.input_gradient.borrow_mut();
        let gradient = self.gradient.borrow()[()];
        let target_data = self.target_data.borrow();

        let iter = input_gradient.outer_iter_mut().enumerate();

        match self.reduction {
            Reduction::Mean => {
                let n = target_data.len() as f32;
                iter.for_each(|(idx, gradient_channel)| {
                    Zip::from(gradient_channel)
                        .and(&*target_data)
                        .for_each(|grad_el, &target| {
                            *grad_el -= gradient * ((target as usize == idx) as u8 as f32) / n
                        })
                });
            }
            Reduction::Sum => {
                iter.for_each(|(idx, gradient_channel)| {
                    Zip::from(gradient_channel)
                        .and(&*target_data)
                        .for_each(|grad_el, &target| {
                            *grad_el -= gradient * (target as usize == idx) as u8 as f32
                        })
                });
            }
        }
    }