#include "eval_add.h"

tensor eval_add::compute(const tensor &a, const tensor &b) {
    tensor c = a + b; 
    return c;
}

void eval_add::eval(vars_type &variables, const kwargs_type &kwargs) {
    assert(inputs_.size() == 2);
    auto ita = variables.find(inputs_[0]);
    auto itb = variables.find(inputs_[1]);
    variables[expr_id_] = compute(ita->second,itb->second);
}

std::shared_ptr<eval_op> eval_add::clone(const expression &expr) {
    return std::make_shared<eval_add>(expr);
}