TfLite 2.13 with -DTFLITE_ENABLE_GPU=ON fails to build with Visual Studio 2019 and 2022
Hi @misterBart, thanks for reporting the issue.

git & cmake are not available natively on windows command prompt so I have a couple of questions in order to reproduce your issue.

Are you using powershell or command prompt? Are you using WSL? Are you using MinGW? Are you using git for windows? If you have trouble understanding these questions, a good first pass is to ask bard: https://bard.google.com/. Ex: "How to tell if I'm using _______?"

Usually the more information you provide, the faster I am able to assist you. Thanks! I'm using Windows Command Prompt.
Installed Git with the Windows installer from https://git-scm.com/download/win
Installed CMake with the Windows installer from https://cmake.org/download/
After installing, git and cmake are available in Windows Command Prompt

By the way, you can also solve the two mentioned compile errors if your replace `std::any_cast` with `absl::any_cast`. I believe this is the preferable solution, because I notice you use `absl::any_cast` more often in the two C++ files in question. Hi @misterBart, our internal tests/tools show it compiles correctly with clang, Is there a way to adjust your cmake installation to use clang? (I'm currently guessing it is using gcc but I'm not sure). I am using cmake with Visual Studio (also see title and opening post), so I'm using Microsoft Visual C++ (MSVC) compiler.

As for your follow-up email: "Hi @misterBart, let us know if you have tried multiple models to help us look into the problem further."
The issue is building TfLite. I have to build TfLite before I can use TfLite models.

To make things clear, I never asked for help. I reported an issue and posted a solution in my opening post and a second solution in my previous comment. I posted these solutions so that one of them could be applied to the TfLite code, so that other people using Visual Studio will not experience this error. Hopefully things are clear now. Hi @misterBart, there are complications/restrictions which make applying those solutions not that simple, but we'll take a deeper look, in the mean time, can you use bazel to unblock yourself? Generally the bazel workflow is better supported for windows/macos and the cmake workflow is better supported for *nix systems. Hi @terryheo, can you please take a look? Thanks @terryheo Have you been able to look at the matter yet?
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

tf 2.13

### Custom code

No

### OS platform and distribution

Windows 10

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

Visual Studio 2019 and 2022

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Building TfLite 2.13 with cmake and `-DTFLITE_ENABLE_GPU=ON` fails if Visual Studio 2019 or 2022 is used. Tested on two different machines, it fails on both machines.
Steps executed in Windows Command Prompt:
```
git clone --single-branch --branch r2.13 https://github.com/tensorflow/tensorflow tensorflow_src
mkdir tflite_build_x64
cd tflite_build_x64
cmake -DTFLITE_ENABLE_GPU=ON ..\tensorflow_src\tensorflow\lite
cmake --build . -j 8 --config Release
```
The cmake build command yields two errors:
```
C:\Users\bartp\source\TfLite2.13Gpu\tensorflow_src\tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc(313,20): error C2039: 'any_cast': is not a member of 'std' [C:\Users\bartp\source\TfLite2.13Gpu\tflite_build_x64\tensorflow-lite.vcxproj]
C:\Users\bartp\source\TfLite2.13Gpu\tensorflow_src\tensorflow\lite\delegates\gpu\common\tasks\special\conv_pointwise.cc(129,12): error C2039: 'any_cast': is not a member of 'std' [C:\Users\bartp\source\TfLite2.13Gpu\tflite_build_x64\tensorflow-lite.vcxproj]
```
To fix this, add `#include <any>` to `tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc` and `tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc`

### Standalone code to reproduce the issue

```shell
To reproduce the issue: see my earlier writing.
```


### Relevant log output

_No response_