示例#1
0
 /// <summary>
 /// Moves the parameters and buffers.
 /// </summary>
 /// <param name="deviceType">The device type, e.g. 'CPU' or 'CUDA'.</param>
 /// <param name="deviceIndex">The optional device index.</param>
 /// <returns></returns>
 public Module to(DeviceType deviceType, int deviceIndex = -1)
 {
     Torch.InitializeDeviceType(deviceType);
     THSNN_Module_to_device(handle, (int)deviceType, deviceIndex);
     Torch.CheckForErrors();
     return(this);
 }