message: release the dynamic array and make the output in TF format when neither of input is mkl format
diff: @@ -116,6 +116,7 @@ class MklAddNOp : public OpKernel {
  E_SUCCESS);
  Tensor* output = nullptr;
  + if (input1_in_mkl_format || input2_in_mkl_format) {
  TensorShape tf_shape;
  mkl_context.output_shape.SetMklTensor(true);
  mkl_context.output_shape.SetMklLayout(mkl_context.Eltwise, dnnResourceDst);
  @@ -131,6 +132,13 @@ class MklAddNOp : public OpKernel {
  AllocateOutputSetMklShape(ctx, 0, &output, tf_shape,
  mkl_context.output_shape);
  + } else {
  + const TensorShape& o_shape = input0.shape();
  + mkl_context.output_shape.SetMklTensor(false);
  + AllocateOutputSetMklShape(ctx, 0, &output, o_shape,
  + mkl_context.output_shape);
  + }
  +
  mkl_context.Eltwise_res[dnnResourceDst] =
  static_cast<void*>(output->flat<T>().data());
  @@ -249,8 +257,16 @@ class MklAddNOp : public OpKernel {
  bool input1_in_mkl_format = input1_shape.IsMklTensor();
  bool input2_in_mkl_format = input2_shape.IsMklTensor();
  dnnDelete_F32(Eltwise);
  - if (!input1_in_mkl_format) dnnLayoutDelete_F32(lt_input1);
  - if (!input2_in_mkl_format) dnnLayoutDelete_F32(lt_input2);
  + if (!input1_in_mkl_format) {
  + dnnLayoutDelete_F32(lt_input1);
  + delete [] in1_sizes;
  + delete [] in1_strides;
  + }
  + if (!input2_in_mkl_format) {
  + dnnLayoutDelete_F32(lt_input2);
  + delete [] in2_sizes;
  + delete [] in2_strides;
  + }
  }
  } MklAddNOpContext;
  };
  