message: Use type erased version of UnrankedMemRefDescriptor to avoid build errors on windows.
diff: @@ -25,6 +25,18 @@ limitations under the License.
  namespace tensorflow {
  +// A type-erased version of the UnrankedMemRefType to allow it to be used
  +// as the return type of an extern "C" function on windows.
  +struct UntypedUnrankedMemRefType {
  + int64_t rank;
  + void* descriptor;
  +};
  +
  +template <typename ElemType>
  +UnrankedMemRefType<ElemType> ConvertToTyped(UntypedUnrankedMemRefType desc) {
  + return {desc.rank, desc.descriptor};
  +}
  +
  // Returns a pointer to an allocated MlirTensorBuffer that takes ownership of
  // pre-allocated memory.
  TensorBuffer* GetMlirTensorBuffer(const void* ptr, size_t size,
  @@ -158,7 +170,7 @@ class MlirUnrankedOp : public OpKernel {
  REGISTER_KERNEL(tf_op, mlir_type, data_type)
  #define GENERATE_BINARY_KERNEL(tf_op, mlir_type, tf_data_type, data_type) \
  - extern "C" ::UnrankedMemRefType<data_type> MLIR_FUNCTION(tf_op, mlir_type)( \
  + extern "C" UntypedUnrankedMemRefType MLIR_FUNCTION(tf_op, mlir_type)( \
  tensorflow::OpKernelContext * ctx, \
  const ::UnrankedMemRefType<data_type>* arg1, \
  const ::UnrankedMemRefType<data_type>* arg2); \
  @@ -173,7 +185,8 @@ class MlirUnrankedOp : public OpKernel {
  static ::UnrankedMemRefType<data_type> Invoke( \
  OpKernelContext* ctx, \
  llvm::ArrayRef<::UnrankedMemRefType<data_type>> args) { \
  - return MLIR_FUNCTION(tf_op, mlir_type)(ctx, &args[0], &args[1]); \
  + return ConvertToTyped<data_type>( \
  + MLIR_FUNCTION(tf_op, mlir_type)(ctx, &args[0], &args[1])); \
  } \
  }; \
  }
  