Skip to content

Commit fa1c743

Browse files
committed
Lint
1 parent 9fd9013 commit fa1c743

File tree

8 files changed

+41
-21
lines changed

8 files changed

+41
-21
lines changed

torchvision/csrc/io/decoder/gpu/gpu_decoder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ void GPUDecoder::seek(double timestamp, bool keyframes_only) {
4646
demuxer.seek(timestamp, flag);
4747
}
4848

49-
c10::Dict<std::string, c10::Dict<std::string, double>>
50-
GPUDecoder::get_metadata() const {
49+
c10::Dict<std::string, c10::Dict<std::string, double>> GPUDecoder::
50+
get_metadata() const {
5151
c10::Dict<std::string, c10::Dict<std::string, double>> metadata;
5252
c10::Dict<std::string, double> video_metadata;
5353
video_metadata.insert("duration", demuxer.get_duration());

torchvision/csrc/io/decoder/util.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ inline size_t getSize(const T& x) {
1212
}
1313

1414
template <typename T>
15-
inline bool
16-
serializeItem(uint8_t* dest, size_t len, size_t& pos, const T& src) {
15+
inline bool serializeItem(
16+
uint8_t* dest,
17+
size_t len,
18+
size_t& pos,
19+
const T& src) {
1720
VLOG(6) << "Generic serializeItem";
1821
const auto required = sizeof(src);
1922
if (len < pos + required) {
@@ -25,8 +28,11 @@ serializeItem(uint8_t* dest, size_t len, size_t& pos, const T& src) {
2528
}
2629

2730
template <typename T>
28-
inline bool
29-
deserializeItem(const uint8_t* src, size_t len, size_t& pos, T& dest) {
31+
inline bool deserializeItem(
32+
const uint8_t* src,
33+
size_t len,
34+
size_t& pos,
35+
T& dest) {
3036
const auto required = sizeof(dest);
3137
if (len < pos + required) {
3238
return false;
@@ -135,8 +141,11 @@ inline bool serializeItem(
135141
rectSerialize(dest, len, pos, src);
136142
}
137143

138-
inline bool
139-
serializeItem(uint8_t* dest, size_t len, size_t& pos, const AVSubtitle& src) {
144+
inline bool serializeItem(
145+
uint8_t* dest,
146+
size_t len,
147+
size_t& pos,
148+
const AVSubtitle& src) {
140149
auto rectSerialize =
141150
[](uint8_t* d, size_t l, size_t& p, const AVSubtitle& x) -> bool {
142151
bool res = serializeItem(d, l, p, x.num_rects);
@@ -217,8 +226,11 @@ inline bool deserializeItem(
217226
rectDeserialize(src, len, pos, dest);
218227
}
219228

220-
inline bool
221-
deserializeItem(const uint8_t* src, size_t len, size_t& pos, AVSubtitle& dest) {
229+
inline bool deserializeItem(
230+
const uint8_t* src,
231+
size_t len,
232+
size_t& pos,
233+
AVSubtitle& dest) {
222234
auto rectDeserialize =
223235
[](const uint8_t* y, size_t l, size_t& p, AVSubtitle& x) -> bool {
224236
bool res = deserializeItem(y, l, p, x.num_rects);

torchvision/csrc/io/video/video.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ std::tuple<std::string, int64_t> Video::getCurrentStream() const {
290290
return current_stream;
291291
}
292292

293-
c10::Dict<std::string, c10::Dict<std::string, std::vector<double>>>
294-
Video::getStreamMetadata() const {
293+
c10::Dict<std::string, c10::Dict<std::string, std::vector<double>>> Video::
294+
getStreamMetadata() const {
295295
TORCH_CHECK(initialized, "Video object has to be initialized first");
296296
return streamsMetadata;
297297
}

torchvision/csrc/io/video/video.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ struct Video : torch::CustomClassHolder {
2121
std::string videoPath = std::string(),
2222
std::string stream = std::string("video"),
2323
int64_t numThreads = 0);
24-
void
25-
initFromFile(std::string videoPath, std::string stream, int64_t numThreads);
24+
void initFromFile(
25+
std::string videoPath,
26+
std::string stream,
27+
int64_t numThreads);
2628
void initFromMemory(
2729
torch::Tensor videoTensor,
2830
std::string stream,

torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void deformable_im2col(
245245
use_64bits_indexing |=
246246
((int64_t)n_in_channels * weight_h * weight_w * parallel_imgs * out_h *
247247
out_w >
248-
std::numeric_limits<int32_t>::max());
248+
std::numeric_limits<int32_t>::max());
249249

250250
if (use_64bits_indexing) {
251251
AT_DISPATCH_FLOATING_TYPES_AND_HALF(

torchvision/csrc/ops/cuda/nms_kernel.cu

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ namespace {
1414
int const threadsPerBlock = sizeof(unsigned long long) * 8;
1515

1616
template <typename T>
17-
__device__ inline bool
18-
devIoU(T const* const a, T const* const b, const float threshold) {
17+
__device__ inline bool devIoU(
18+
T const* const a,
19+
T const* const b,
20+
const float threshold) {
1921
T left = max(a[0], b[0]), right = min(a[2], b[2]);
2022
T top = max(a[1], b[1]), bottom = min(a[3], b[3]);
2123
T width = max(right - left, (T)0), height = max(bottom - top, (T)0);

torchvision/csrc/ops/nms.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
namespace vision {
88
namespace ops {
99

10-
at::Tensor
11-
nms(const at::Tensor& dets, const at::Tensor& scores, double iou_threshold) {
10+
at::Tensor nms(
11+
const at::Tensor& dets,
12+
const at::Tensor& scores,
13+
double iou_threshold) {
1214
C10_LOG_API_USAGE_ONCE("torchvision.csrc.ops.nms.nms");
1315
static auto op = c10::Dispatcher::singleton()
1416
.findSchemaOrThrow("torchvision::nms", "")

torchvision/csrc/ops/nms.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
namespace vision {
77
namespace ops {
88

9-
VISION_API at::Tensor
10-
nms(const at::Tensor& dets, const at::Tensor& scores, double iou_threshold);
9+
VISION_API at::Tensor nms(
10+
const at::Tensor& dets,
11+
const at::Tensor& scores,
12+
double iou_threshold);
1113

1214
} // namespace ops
1315
} // namespace vision

0 commit comments

Comments
 (0)