def test_prepend_dim(self):
    devices = [core.DeviceOption(caffe2_pb2.CPU, 0)]
    if (workspace.NumGpuDevices() > 0):
        devices.append(core.DeviceOption(workspace.GpuDeviceType, 0))
    for device_opt in devices:
        with core.DeviceScope(device_opt):
            self._test_fwd_bwd()
def test_prepend_dim(self):
    devices = [core.DeviceOption(caffe2_pb2.CPU, 0)]
    if (workspace.NumGpuDevices() > 0):
        devices.append(core.DeviceOption(workspace.GpuDeviceType, 0))
    for device_opt in devices:
        with core.DeviceScope(device_opt):
            self._test_fwd_bwd()