message: Update TF_AllocateOutput to just call ctx->allocate_output now that TF_Tensor just wraps a Tensor.
diff: @@ -248,15 +248,22 @@ TF_Tensor* TF_AllocateOutput(TF_OpKernelContext* context, int index,
  size_t len, TF_Status* status) {
  TF_SetStatus(status, TF_OK, "");
  auto* cc_ctx = reinterpret_cast<::tensorflow::OpKernelContext*>(context);
  - tensorflow::AllocatorAttributes attr = cc_ctx->output_alloc_attr(index);
  - auto* allocator = cc_ctx->get_allocator(attr);
  - void* data = tensorflow::allocate_tensor("TF_AllocateOutput", len, allocator);
  - TF_Tensor* result = TF_NewTensor(dtype, dims, num_dims, data, len,
  - tensorflow::deallocate_buffer, allocator);
  - TF_SetOutput(context, index, result, status);
  - if (TF_GetCode(status) != TF_OK) {
  - TF_DeleteTensor(result);
  +
  + static_assert(sizeof(int64_t) == sizeof(tensorflow::int64),
  + "64-bit int types should match in size");
  + tensorflow::gtl::ArraySlice<tensorflow::int64> dimarray(
  + reinterpret_cast<tensorflow::int64*>(dims), num_dims);
  + tensorflow::Tensor* tensor;
  + tensorflow::Status s = cc_ctx->allocate_output(
  + index, tensorflow::TensorShape(dimarray), &tensor);
  + if (!s.ok()) {
  + ::tensorflow::Set_TF_Status_from_Status(status, s);
  return nullptr;
  }
  - return result;
  + TF_Tensor* tf_tensor = TF_TensorFromTensor(*tensor, &s);
  + if (!s.ok()) {
  + ::tensorflow::Set_TF_Status_from_Status(status, s);
  + return nullptr;
  + }
  + return tf_tensor;
  }
  