@peterjc123
Thanks to the solution you provided, the LNK1102 (out of memory) issue has been resolved.
And the sample code above is worked correctly building with following settings:

/WHOLEARCHIVE: torch_cpu.lib  torch_cuda.lib c10_cuda.lib
link cuda, cudnn libs

Thx !