int h_off, w_off;
// We only do random crop when we do training.
if (Caffe::phase() == Caffe::TRAIN) {
+ // NOLINT_NEXT_LINE(runtime/threadsafe_fn)
h_off = rand() % (height - cropsize);
+ // NOLINT_NEXT_LINE(runtime/threadsafe_fn)
w_off = rand() % (width - cropsize);
} else {
h_off = (height - cropsize) / 2;
w_off = (width - cropsize) / 2;
}
+ // NOLINT_NEXT_LINE(runtime/threadsafe_fn)
if (mirror && rand() % 2) {
// Copy mirrored version
for (int c = 0; c < channels; ++c) {
lines_id_ = 0;
// Check if we would need to randomly skip a few data points
if (this->layer_param_.rand_skip()) {
+ // NOLINT_NEXT_LINE(runtime/threadsafe_fn)
unsigned int skip = rand() % this->layer_param_.rand_skip();
LOG(INFO) << "Skipping first " << skip << " data points.";
CHECK_GT(lines_.size(), skip) << "Not enought points to skip";