Caffe2 - Python API
A deep learning, cross platform ML framework
vision.py
1 import torch
2 import torch.backends.cudnn as cudnn
3 from ..._jit_internal import weak_script
4 
5 
6 @weak_script
7 def affine_grid_generator(theta, size):
8  # type: (Tensor, List[int]) -> Tensor
9  if theta.is_cuda and cudnn.enabled and cudnn.is_acceptable(theta) and len(size) == 4 and size[0] < 65536:
10  N, C, H, W = size
11  ret = torch.cudnn_affine_grid_generator(theta, N, C, H, W)
12  else:
13  ret = torch.affine_grid_generator(theta, size)
14  return ret