#include "eval_input2d.h"

eval_input2d::eval_input2d(const expression &expr): eval_op(expr), height(expr.get_op_param_int("height")), width(expr.get_op_param_int("width")) {
}

void eval_input2d::eval(vars_type &variables, const kwargs_type &kwargs) {
   // Retrieve the tensor directly from kwargs using op_name_
   tensor t = kwargs.at(op_name_);

   // For debugging: print the input tensor
   std::cout << "Input Tensor for Input2d (op_name " << op_name_ << "):" << std::endl;
   //t.print();

   // Perform the Input2d operation
   tensor input2dResult = Input2d(t);

   // Store the result in variables under the key expr_id_
   variables[expr_id_] = input2dResult;
}

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