1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Reduce sum operation.

use crate::{
    builder, node_to_inner,
    nodes::{Axes, Node},
};

/// Reduce sum node.
pub struct ReduceSum {
    inner: Node,
}

impl ReduceSum {
    /// Creates new reduce sum operation.
    pub fn new<S: Into<String>, A: Into<Axes>>(input: S, axes: A, keepdims: bool) -> Self {
        ReduceSum {
            inner: builder::Node::new("ReduceSum")
                .input(input)
                .attribute("axes", axes.into())
                .attribute("keepdims", keepdims)
                .build(),
        }
    }
}

node_to_inner!(ReduceSum);