-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path223-easy-bugs.json
More file actions
5660 lines (5660 loc) · 405 KB
/
223-easy-bugs.json
File metadata and controls
5660 lines (5660 loc) · 405 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"repo": "microsoft/vscode",
"prNumber": 222123,
"prTitle": "dispose of watch expr listener when it's removed",
"prLink": "https://github.com/microsoft/vscode/pull/222123",
"commentAuthor": "roblourens",
"commentBody": "It looks like if id is null, we removed _all_ expressions and can dispose all the listeners",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/microsoft/vscode/pull/222123#discussion_r1684614161",
"filePath": "src/vs/workbench/contrib/debug/common/debugModel.ts",
"diffHunk": "@@ -2032,6 +2033,10 @@ export class DebugModel extends Disposable implements IDebugModel {\n \tremoveWatchExpressions(id: string | null = null): void {\n \t\tthis.watchExpressions = id ? this.watchExpressions.filter(we => we.getId() !== id) : [];\n \t\tthis._onDidChangeWatchExpressions.fire(undefined);\n+\t\tif (!id) {",
"line": 30,
"reactionCount": 1,
"timestamp": "2024-07-19T16:29:48Z",
"isReviewComment": true,
"pullRequestReviewId": 2188635079,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"prAuthor": "meganrogge",
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T01:54:44.025Z"
},
{
"repo": "facebook/react",
"prNumber": 18248,
"prTitle": "[DevTools] Add shortcut keys for tab switching",
"prLink": "https://github.com/facebook/react/pull/18248",
"commentAuthor": "bvaughn",
"commentBody": "Looks like you removed the cleanup function by accident (where you remove the event listener).",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/18248#discussion_r393805715",
"filePath": "packages/react-devtools-shared/src/devtools/views/DevTools.js",
"diffHunk": "@@ -127,6 +127,33 @@ export default function DevTools({\n [enabledInspectedElementContextMenu, viewAttributeSourceFunction],\n );\n \n+ const devToolsRef = useRef<HTMLElement | null>(null);\n+\n+ useEffect(() => {\n+ if (devToolsRef.current === null) return;\n+\n+ const ownerWindow = devToolsRef.current.ownerDocument.defaultView;\n+\n+ if (showTabBar) {\n+ ownerWindow.addEventListener('keydown', (event: KeyboardEvent) => {\n+ if (event.ctrlKey || event.metaKey) {\n+ switch (event.key) {\n+ case '1':\n+ setTab(tabs[0].id);\n+ event.preventDefault();\n+ event.stopPropagation();\n+ break;\n+ case '2':\n+ setTab(tabs[1].id);\n+ event.preventDefault();\n+ event.stopPropagation();\n+ break;\n+ }\n+ }\n+ });\n+ }",
"line": 48,
"reactionCount": 0,
"timestamp": "2020-03-17T16:23:51Z",
"isReviewComment": true,
"pullRequestReviewId": 376196870,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "kerolloz",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:11.861Z"
},
{
"repo": "facebook/react",
"prNumber": 13482,
"prTitle": "Use destructures",
"prLink": "https://github.com/facebook/react/pull/13482",
"commentAuthor": "gaearon",
"commentBody": "This is not equivalent. Instead, it's like `(event || 'unknown-event').type`.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/13482#discussion_r212804900",
"filePath": "packages/events/EventPluginUtils.js",
"diffHunk": "@@ -65,7 +65,7 @@ if (__DEV__) {\n * @param {*} inst Internal component instance\n */\n function executeDispatch(event, simulated, listener, inst) {\n- const type = event.type || 'unknown-event';\n+ const {type} = event || 'unknown-event';",
"line": 5,
"reactionCount": 0,
"timestamp": "2018-08-25T18:04:17Z",
"isReviewComment": true,
"pullRequestReviewId": 149517099,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "prashant-andani",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:11.802Z"
},
{
"repo": "facebook/react",
"prNumber": 11821,
"prTitle": "Deduplication of warn when selected is set on <option>",
"prLink": "https://github.com/facebook/react/pull/11821",
"commentAuthor": "gaearon",
"commentBody": "Actually I think this is wrong. This means we only *check* once, not warn once.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/11821#discussion_r155947080",
"filePath": "packages/react-dom/src/client/ReactDOMFiberOption.js",
"diffHunk": "@@ -36,11 +38,14 @@ function flattenChildren(children) {\n export function validateProps(element: Element, props: Object) {\n // TODO (yungsters): Remove support for `selected` in <option>.\n if (__DEV__) {\n- warning(\n- props.selected == null,\n- 'Use the `defaultValue` or `value` props on <select> instead of ' +\n- 'setting `selected` on <option>.',\n- );\n+ if (!didWarnSelectedSetOnOption) {",
"line": 18,
"reactionCount": 0,
"timestamp": "2017-12-10T13:07:11Z",
"isReviewComment": true,
"pullRequestReviewId": 82349772,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "watadarkstar",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:13.729Z"
},
{
"repo": "facebook/react",
"prNumber": 9018,
"prTitle": "Adding movementX and movementY to synthenticMouseEvent fixes #6723",
"prLink": "https://github.com/facebook/react/pull/9018",
"commentAuthor": "gaearon",
"commentBody": "I think the check here intends to check against `null` but will accidentally also be falsy if `screenX` is actually equal to `0`. Please avoid truthy checks like this, they tend to hide bugs.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/9018#discussion_r195876735",
"filePath": "packages/react-dom/src/events/SyntheticMouseEvent.js",
"diffHunk": "@@ -34,6 +37,24 @@ const SyntheticMouseEvent = SyntheticUIEvent.extend({\n : event.fromElement)\n );\n },\n+ movementX: function(event) {\n+ if ('movementX' in event) {\n+ return event.movementX;\n+ }\n+\n+ const screenX = previousScreenX;\n+ previousScreenX = event.screenX;\n+ return screenX ? event.screenX - screenX : 0;",
"line": 21,
"reactionCount": 2,
"timestamp": "2018-06-15T22:33:45Z",
"isReviewComment": true,
"pullRequestReviewId": 129334830,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "jasonwilliams",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:15.371Z"
},
{
"repo": "facebook/react",
"prNumber": 6636,
"prTitle": "Integrated warning on returning null",
"prLink": "https://github.com/facebook/react/pull/6636",
"commentAuthor": "zpao",
"commentBody": "We already know that `initialState === undefined` so this condition will never be met and we'll always warn. It's also an entirely unactionable warning as this only happens when a component is mocked.\n",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/6636#discussion_r61356235",
"filePath": "src/isomorphic/classic/class/ReactClass.js",
"diffHunk": "@@ -778,8 +778,11 @@ var ReactClass = {\n // We allow auto-mocks to proceed as if they're returning null.\n if (initialState === undefined &&\n this.getInitialState._isMockFunction) {\n- // This is probably bad practice. Consider warning here and\n- // deprecating this convenience.\n+ warning(\n+ typeof initialState === 'object' && initialState == null && !Array.isArray(initialState),",
"line": 7,
"reactionCount": 0,
"timestamp": "2016-04-27T23:55:23Z",
"isReviewComment": true,
"pullRequestReviewId": null,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "evenstensberg",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:17.400Z"
},
{
"repo": "facebook/react",
"prNumber": 3306,
"prTitle": "Correctly render MozMacOSXFontSmoothing. Fixes #3302.",
"prLink": "https://github.com/facebook/react/pull/3306",
"commentAuthor": "zpao",
"commentBody": "triple equals (time to enable lint here).\n\nAlso this comparison is actually wrong. The string would start with a hyphen.\n",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/facebook/react/pull/3306#discussion_r25744134",
"filePath": "src/vendor/core/camelizeStyleName.js",
"diffHunk": "@@ -34,6 +34,10 @@ var msPattern = /^-ms-/;\n * @return {string}\n */\n function camelizeStyleName(string) {\n+ if (string == 'moz-mac-osx-font-smoothing') {",
"line": 4,
"reactionCount": 0,
"timestamp": "2015-03-04T01:01:41Z",
"isReviewComment": true,
"pullRequestReviewId": null,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "jimfb",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:19.966Z"
},
{
"repo": "scikit-learn/scikit-learn",
"prNumber": 29036,
"prTitle": "Fix codecov in tests for array api in pairwise metrics",
"prLink": "https://github.com/scikit-learn/scikit-learn/pull/29036",
"commentAuthor": "EdAbati",
"commentBody": "Hi all, just realised that we are not passing the `metric_kwargs` to the function (also in the function call below). I think it should be:\r\n\r\n```python\r\ncheck_array_api_metric(\r\n metric, array_namespace, device, dtype_name, a_np=X_np, b_np=Y_np, ** metric_kwargs\r\n )\r\n```\r\n\r\nshould I make another PR?",
"commentBodyIncludesCodeSnippet": true,
"commentLink": "https://github.com/scikit-learn/scikit-learn/pull/29036#discussion_r1605260300",
"filePath": "sklearn/metrics/tests/test_common.py",
"diffHunk": "@@ -1896,6 +1896,10 @@ def check_array_api_metric_pairwise(metric, array_namespace, device, dtype_name)\n \n metric_kwargs = {}\n if \"dense_output\" in signature(metric).parameters:\n+ metric_kwargs[\"dense_output\"] = False\n+ check_array_api_metric(\n+ metric, array_namespace, device, dtype_name, a_np=X_np, b_np=Y_np\n+ )",
"line": 7,
"reactionCount": 2,
"timestamp": "2024-05-17T16:17:58Z",
"isReviewComment": true,
"pullRequestReviewId": 2063865000,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "OmarManzoor",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:19.926Z"
},
{
"repo": "scikit-learn/scikit-learn",
"prNumber": 27857,
"prTitle": "MAINT remove option penalty='none' in LogisticRegression",
"prLink": "https://github.com/scikit-learn/scikit-learn/pull/27857",
"commentAuthor": "lorentzenchr",
"commentBody": "This even seems to fix a rare bug with penalty=None not raising.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/scikit-learn/scikit-learn/pull/27857#discussion_r1406845616",
"filePath": "sklearn/linear_model/_logistic.py",
"diffHunk": "@@ -63,26 +63,21 @@\n \n \n def _check_solver(solver, penalty, dual):\n- # TODO(1.4): Remove \"none\" option\n- if solver not in [\"liblinear\", \"saga\"] and penalty not in (\"l2\", \"none\", None):\n+ if solver not in [\"liblinear\", \"saga\"] and penalty not in (\"l2\", None):\n raise ValueError(\n- \"Solver %s supports only 'l2' or 'none' penalties, got %s penalty.\"\n- % (solver, penalty)\n+ f\"Solver {solver} supports only 'l2' or None penalties, got {penalty} \"\n+ \"penalty.\"\n )\n if solver != \"liblinear\" and dual:\n- raise ValueError(\n- \"Solver %s supports only dual=False, got dual=%s\" % (solver, dual)\n- )\n+ raise ValueError(f\"Solver {solver} supports only dual=False, got dual={dual}\")\n \n if penalty == \"elasticnet\" and solver != \"saga\":\n raise ValueError(\n- \"Only 'saga' solver supports elasticnet penalty, got solver={}.\".format(\n- solver\n- )\n+ f\"Only 'saga' solver supports elasticnet penalty, got solver={solver}.\"\n )\n \n- if solver == \"liblinear\" and penalty == \"none\":\n- raise ValueError(\"penalty='none' is not supported for the liblinear solver\")\n+ if solver == \"liblinear\" and penalty is None:",
"line": 29,
"reactionCount": 0,
"timestamp": "2023-11-27T22:33:33Z",
"isReviewComment": true,
"pullRequestReviewId": 1751532851,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "glemaitre",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:19.830Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 83318,
"prTitle": "Add tf_keras installation and import statements to tf.autodiff.ForwardAccumulator example",
"prLink": "https://github.com/tensorflow/tensorflow/pull/83318",
"commentAuthor": "mihaimaruseac",
"commentBody": "This is not a line that can be executed in the Python interpreter",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/83318#discussion_r1892064498",
"filePath": "tensorflow/python/eager/forwardprop.py",
"diffHunk": "@@ -240,6 +240,12 @@ class ForwardAccumulator():\n \n Consider a simple linear regression:\n \n+ >>> pip install tf_keras",
"line": 4,
"reactionCount": 0,
"timestamp": "2024-12-19T13:24:07Z",
"isReviewComment": true,
"pullRequestReviewId": 2514655628,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "gaikwadrahul8",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T01:54:19.356Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 54210,
"prTitle": "Update image_ops_impl.py",
"prLink": "https://github.com/tensorflow/tensorflow/pull/54210",
"commentAuthor": "AdityaKane2001",
"commentBody": "`x` is undefined here. Please check. ",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/54210#discussion_r795853931",
"filePath": "tensorflow/python/ops/image_ops_impl.py",
"diffHunk": "@@ -2168,6 +2168,14 @@ def adjust_brightness(image, delta):\n flt_image = image\n else:\n flt_image = convert_image_dtype(image, dtypes.float32)\n+ \n+ flag = True\n+ for i in ((x.numpy().ravel())/255):",
"line": 6,
"reactionCount": 0,
"timestamp": "2022-01-31T16:38:17Z",
"isReviewComment": true,
"pullRequestReviewId": 868117515,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "Cheril311",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:26.773Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 52485,
"prTitle": "[tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc] Add calls to `reserve()` before populating vector",
"prLink": "https://github.com/tensorflow/tensorflow/pull/52485",
"commentAuthor": "akuegel",
"commentBody": "I think this reserve call is not needed. In the line before, the vector is already allocated with \"result_rank\" many items, and in the loop, no further items are added, just the allocated items are initialized.\r\nThis PR can be closed.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/52485#discussion_r729689713",
"filePath": "tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc",
"diffHunk": "@@ -126,6 +126,7 @@ class DynamicStitchOp : public XlaOpKernel {\n int64_t result_rank = 1 + data0_shape.dims() - indices0_shape.dims();\n if (number_of_indices == 0) {\n std::vector<int64_t> result_shape(result_rank);\n+ result_shape.reserve(data0_shape.dims());",
"line": 4,
"reactionCount": 0,
"timestamp": "2021-10-15T10:03:29Z",
"isReviewComment": true,
"pullRequestReviewId": 780673504,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "SamuelMarks",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:26.824Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 50073,
"prTitle": "[MLIR] Add GatherOp lowering from lmhlo to Affine.",
"prLink": "https://github.com/tensorflow/tensorflow/pull/50073",
"commentAuthor": "joker-eph",
"commentBody": "eltType is not declared",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/50073#discussion_r653221542",
"filePath": "tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc",
"diffHunk": "@@ -176,6 +176,309 @@ struct ConcatOpConverter : public OpRewritePattern<ConcatenateOp> {\n }\n };\n \n+/// Returns a zero value of type `type`. `type` is expected to be either\n+/// int or float.\n+static Value getZeroValue(Type type, Location loc,\n+ PatternRewriter& rewriter) {\n+ assert(eltType.isIntOrFloat() && \"Expected int or float\");",
"line": 8,
"reactionCount": 0,
"timestamp": "2021-06-17T04:46:48Z",
"isReviewComment": true,
"pullRequestReviewId": 685861103,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "avarmapml",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:26.775Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 47385,
"prTitle": "Port micro op EXPAND_DIMS for it to pass the tests",
"prLink": "https://github.com/tensorflow/tensorflow/pull/47385",
"commentAuthor": "AIWintermuteAI",
"commentBody": "Should it be Register_EXPAND_DIMS()? I had runtime error until I changed it to Register_EXPAND_DIMS(), since EXP is a different op and has different requirements.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/47385#discussion_r594008869",
"filePath": "tensorflow/lite/micro/micro_mutable_op_resolver.h",
"diffHunk": "@@ -214,6 +214,11 @@ class MicroMutableOpResolver : public MicroOpResolver {\n return AddBuiltin(BuiltinOperator_EXP, Register_EXP(), ParseExp);\n }\n \n+ TfLiteStatus AddExpandDims() {\n+ return AddBuiltin(BuiltinOperator_EXPAND_DIMS, Register_EXP(),",
"line": 5,
"reactionCount": 1,
"timestamp": "2021-03-15T02:15:58Z",
"isReviewComment": true,
"pullRequestReviewId": 611781507,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "rsun-bdti",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:26.834Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 38076,
"prTitle": "R2.1 Update fixes #38075",
"prLink": "https://github.com/tensorflow/tensorflow/pull/38076",
"commentAuthor": "mihaimaruseac",
"commentBody": "This line breaks Python syntax",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/38076#discussion_r423374829",
"filePath": "tensorflow/python/keras/layers/convolutional_test.py",
"diffHunk": "@@ -163,6 +163,11 @@ def test_conv2d_constraints(self):\n layer.build((None, 5, 5, 2))\n self.assertEqual(layer.kernel.constraint, k_constraint)\n self.assertEqual(layer.bias.constraint, b_constraint)\n+ \n+ def test_conv2d_zero_kernel_size(self):\n+ kwargs = {'filters': 2, 'kernel_size': 0}\n+ with self.assertRaises(ValueError):\n+ keras.layers.Conv2D(**kwargs)",
"line": 8,
"reactionCount": 0,
"timestamp": "2020-05-11T23:23:14Z",
"isReviewComment": true,
"pullRequestReviewId": 409597479,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "maxkaustav",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:28.663Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 38464,
"prTitle": "[Intel MKL] Enable remapper unit tests for CPU builds.",
"prLink": "https://github.com/tensorflow/tensorflow/pull/38464",
"commentAuthor": "ezhulenev",
"commentBody": "This will prevent all tests hidden behind #if GOOGLE_CUDA from running, and there are few that are important.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/38464#discussion_r408398865",
"filePath": "tensorflow/core/grappler/optimizers/BUILD",
"diffHunk": "@@ -869,7 +869,7 @@ tf_kernel_library(\n ],\n )\n \n-tf_cuda_cc_test(\n+tf_cc_test(",
"line": 5,
"reactionCount": 0,
"timestamp": "2020-04-14T19:59:16Z",
"isReviewComment": true,
"pullRequestReviewId": 393250931,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "agramesh1",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:30.629Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 37947,
"prTitle": "Tf",
"prLink": "https://github.com/tensorflow/tensorflow/pull/37947",
"commentAuthor": "mihaimaruseac",
"commentBody": "Merge conflict markers. These should not be left in the PR",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/37947#discussion_r398799902",
"filePath": "tensorflow/python/keras/layers/convolutional.py",
"diffHunk": "@@ -3030,6 +5622,15 @@ def get_config(self):\n SeparableConvolution1D = SeparableConv1D\n SeparableConvolution2D = SeparableConv2D\n Convolution2DTranspose = Conv2DTranspose\n+<<<<<<< HEAD",
"line": 2625,
"reactionCount": 0,
"timestamp": "2020-03-26T18:29:37Z",
"isReviewComment": true,
"pullRequestReviewId": 382296814,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "ghosalsattam",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:30.450Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 37425,
"prTitle": "extending 'tf.keras.Model.evaluate' API to permit using class_weight directly.",
"prLink": "https://github.com/tensorflow/tensorflow/pull/37425",
"commentAuthor": "qlzh727",
"commentBody": "evaluate_generator() is missing the class_weight param, which cause test failure. Please check the test log.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/37425#discussion_r407863261",
"filePath": "tensorflow/python/keras/engine/training.py",
"diffHunk": "@@ -1434,6 +1441,7 @@ def evaluate_generator(self,\n workers=workers,\n use_multiprocessing=use_multiprocessing,\n verbose=verbose,\n+ class_weight=class_weight,",
"line": 47,
"reactionCount": 0,
"timestamp": "2020-04-14T04:41:48Z",
"isReviewComment": true,
"pullRequestReviewId": 392598992,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "ayushmankumar7",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:30.947Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 35786,
"prTitle": "Some C++ fixes",
"prLink": "https://github.com/tensorflow/tensorflow/pull/35786",
"commentAuthor": "sanjoy",
"commentBody": "I don't think this is correct. `max_length` is the length `value` and so if it is `0` then there is nothing to do here.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/35786#discussion_r366968026",
"filePath": "tensorflow/c/c_api.cc",
"diffHunk": "@@ -1344,7 +1344,8 @@ void TF_OperationGetAttrString(TF_Operation* oper, const char* attr_name,\n InvalidArgument(\"Attribute '\", attr_name, \"' is not a string\");\n return;\n }\n- if (max_length <= 0) {\n+ if (max_length == 0) {\n+ status->status = InvalidArgument(\"Attribute '\", max_length, \"' is zero\");",
"line": 6,
"reactionCount": 0,
"timestamp": "2020-01-15T16:15:33Z",
"isReviewComment": true,
"pullRequestReviewId": 343340954,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "gaurav1086",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:30.190Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 31045,
"prTitle": "Validate dict returned by input_map_fn for calibration",
"prLink": "https://github.com/tensorflow/tensorflow/pull/31045",
"commentAuthor": "reactivetype",
"commentBody": "@pooyadavoodi in line 607, `tf` is not an imported module and the commit is breaking calibration. ",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/31045#discussion_r315814115",
"filePath": "tensorflow/python/compiler/tensorrt/trt_convert.py",
"diffHunk": "@@ -600,6 +600,13 @@ def calibrate(self,\n raise ValueError(\n \"Should specify one and only one of feed_dict_fn and input_map_fn.\")\n \n+ if input_map_fn:\n+ for k, v in input_map_fn().items():\n+ if not isinstance(k, str):\n+ raise ValueError(\"Keys of input_map_fn must be of type str\")\n+ if not isinstance(v, tf.Tensor):",
"line": 8,
"reactionCount": 0,
"timestamp": "2019-08-20T17:31:20Z",
"isReviewComment": true,
"pullRequestReviewId": 277325623,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "pooyadavoodi",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:34.316Z"
},
{
"repo": "tensorflow/tensorflow",
"prNumber": 27411,
"prTitle": "Lite: Add_n Op refactored",
"prLink": "https://github.com/tensorflow/tensorflow/pull/27411",
"commentAuthor": "haozha111",
"commentBody": "Note that you didn't manage to free this piece of memory at the end. It will cause memory leaks.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/tensorflow/tensorflow/pull/27411#discussion_r271990562",
"filePath": "tensorflow/lite/kernels/add_n.cc",
"diffHunk": "@@ -42,6 +58,21 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {\n TF_LITE_ENSURE_EQ(context, input1->type, input->type);\n }\n \n+ OpData* data = reinterpret_cast<OpData*>(node->user_data);\n+ data->num_inputs = NumInputs(node);\n+ if (output->type == kTfLiteFloat32) {\n+ data->all_inputs = reinterpret_cast<void*>(\n+ new VectorOfTensors<float>(*context, *node->inputs));",
"line": 42,
"reactionCount": 1,
"timestamp": "2019-04-04T01:33:51Z",
"isReviewComment": true,
"pullRequestReviewId": 222524717,
"LLMReviewed": true,
"LLMReviewPassed": true,
"prAuthor": "ANSHUMAN87",
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:34.302Z"
},
{
"repo": "pytorch/pytorch",
"prNumber": 137251,
"prTitle": "[compiled autograd] add opaque_cpp_node mode",
"prAuthor": "xmfan",
"prLink": "https://github.com/pytorch/pytorch/pull/137251",
"commentAuthor": "jansel",
"commentBody": "This should raise an exception not return False. You aren't checking the return value when you call it.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/pytorch/pytorch/pull/137251#discussion_r1788503873",
"filePath": "torch/csrc/dynamo/python_compiled_autograd.cpp",
"diffHunk": "@@ -359,12 +362,29 @@ static PyObject* set_verbose_logger(PyObject* dummy, PyObject* args) {\n END_HANDLE_TH_ERRORS;\n }\n \n+static PyObject* set_opaque_cpp_node(PyObject* dummy, PyObject* args) {\n+ HANDLE_TH_ERRORS;\n+ PyObject* enable = nullptr;\n+ if (!PyArg_ParseTuple(args, \"O\", &enable)) {\n+ Py_RETURN_FALSE;",
"line": 18,
"reactionCount": 0,
"reactions": [],
"timestamp": "2024-10-05T03:57:52Z",
"isReviewComment": true,
"pullRequestReviewId": 2349481383,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:37.987Z"
},
{
"repo": "kubernetes/kubernetes",
"prNumber": 127300,
"prTitle": "[FG:InPlacePodVerticalScaling] kubelet: Propagate error in doPodResizeAction() to the caller",
"prAuthor": "hshiina",
"prLink": "https://github.com/kubernetes/kubernetes/pull/127300",
"commentAuthor": "tallclair",
"commentBody": "This is unconditionally returning an error for this function.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/kubernetes/kubernetes/pull/127300#discussion_r1833787098",
"filePath": "pkg/kubelet/kuberuntime/kuberuntime_manager.go",
"diffHunk": "@@ -673,10 +674,7 @@ func (m *kubeGenericRuntimeManager) doPodResizeAction(pod *v1.Pod, podStatus *ku\n \t\tcase v1.ResourceMemory:\n \t\t\terr = pcm.SetPodCgroupConfig(pod, rName, podResources)\n \t\t}\n-\t\tif err != nil {\n-\t\t\tklog.ErrorS(err, \"Failed to set cgroup config\", \"resource\", rName, \"pod\", pod.Name)\n-\t\t}\n-\t\treturn err\n+\t\treturn fmt.Errorf(\"failed to set cgroup config for %s of pod %s: %w\", rName, format.Pod(pod), err)",
"line": 26,
"reactionCount": 0,
"reactions": [],
"timestamp": "2024-11-08T06:41:21Z",
"isReviewComment": true,
"pullRequestReviewId": 2422823430,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:42.389Z"
},
{
"repo": "kubernetes/kubernetes",
"prNumber": 126254,
"prTitle": "Make FitError improve readability",
"prAuthor": "utam0k",
"prLink": "https://github.com/kubernetes/kubernetes/pull/126254",
"commentAuthor": "ingvagabund",
"commentBody": "`sortedFilterMsg` is still not sorted here",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/kubernetes/kubernetes/pull/126254#discussion_r1709682380",
"filePath": "pkg/scheduler/framework/types.go",
"diffHunk": "@@ -391,32 +391,29 @@ func (f *FitError) Error() string {\n \t\t// PreFilter plugin returns unschedulable.\n \t\t// Add the messages from PreFilter plugins to reasonMsg.\n \t\treasonMsg += fmt.Sprintf(\" %v.\", preFilterMsg)\n-\t}\n-\n-\tif preFilterMsg == \"\" {\n+\t} else {\n \t\t// the scheduling cycle went through PreFilter extension point successfully.\n \t\t//\n \t\t// When the prefilter plugin returns unschedulable,\n \t\t// the scheduling framework inserts the same unschedulable status to all nodes in NodeToStatusMap.\n \t\t// So, we shouldn't add the message from NodeToStatusMap when the PreFilter failed.\n \t\t// Otherwise, we will have duplicated reasons in the error message.\n-\t\treasons := make(map[string]int)\n+\t\treasonHistogram := make(map[string]int)\n \t\tfor _, status := range f.Diagnosis.NodeToStatusMap {\n \t\t\tfor _, reason := range status.Reasons() {\n-\t\t\t\treasons[reason]++\n+\t\t\t\treasonHistogram[reason]++\n \t\t\t}\n \t\t}\n \n-\t\tsortReasonsHistogram := func() []string {\n-\t\t\tvar reasonStrings []string\n-\t\t\tfor k, v := range reasons {\n-\t\t\t\treasonStrings = append(reasonStrings, fmt.Sprintf(\"%v %v\", v, k))\n-\t\t\t}\n-\t\t\tsort.Strings(reasonStrings)\n-\t\t\treturn reasonStrings\n+\t\tvar sortedFilterMsg []string\n+\t\tfor msg, count := range reasonHistogram {\n+\t\t\tsortedFilterMsg = append(sortedFilterMsg, fmt.Sprintf(\"%v %v\", count, msg))\n \t\t}\n-\t\tsortedFilterMsg := sortReasonsHistogram()\n+\n \t\tif len(sortedFilterMsg) != 0 {",
"line": 36,
"reactionCount": 0,
"reactions": [],
"timestamp": "2024-08-08T14:49:51Z",
"isReviewComment": true,
"pullRequestReviewId": 2228121871,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:42.435Z"
},
{
"repo": "kubernetes/kubernetes",
"prNumber": 119748,
"prTitle": "Added Kind/ResourceScope support in APIService model",
"prAuthor": "AryanSharma9917",
"prLink": "https://github.com/kubernetes/kubernetes/pull/119748",
"commentAuthor": "armstrongli",
"commentBody": "the protobuf number is not right. there are 2 `2`s. please correct them. the rest is good.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/kubernetes/kubernetes/pull/119748#discussion_r1306607822",
"filePath": "staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/types.go",
"diffHunk": "@@ -93,6 +93,32 @@ type APIServiceSpec struct {\n \n \t// leaving this here so everyone remembers why proto index 6 is skipped\n \t// Priority int64 `json:\"priority\" protobuf:\"varint,6,opt,name=priority\"`\n+\n+\t// ScopedResources declares a range of scoped resources to tell what resources to provide by the APIService. there can be more resources provided\n+\t// by the servicebackend. k8s aggregator focuses on the resources declared by ScopedResources, if it is defined.\n+\tScopedResources []ScopedResource `json:\"scopedResources,omitempty\" protobuf:\"bytes,7,opt,name=scopedResources\"`\n+}\n+\n+type ResourceScope string\n+\n+const (\n+\tResourceScopeCluster ResourceScope = \"Cluster\"\n+\tResourceScopeNamespace ResourceScope = \"Namespace\"\n+)\n+\n+type ScopedResource struct {\n+\tResourceScope ResourceScope `json:\"resourceScope\" protobuf:\"bytes,2,name=resourceScope\"`",
"line": 18,
"reactionCount": 1,
"reactions": [
{
"id": 216521465,
"node_id": "REA_lATOAToIks5N4UDOzgzn2vk",
"user": {
"login": "AryanSharma9917",
"id": 72792907,
"node_id": "MDQ6VXNlcjcyNzkyOTA3",
"avatar_url": "https://avatars.githubusercontent.com/u/72792907?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AryanSharma9917",
"html_url": "https://github.com/AryanSharma9917",
"followers_url": "https://api.github.com/users/AryanSharma9917/followers",
"following_url": "https://api.github.com/users/AryanSharma9917/following{/other_user}",
"gists_url": "https://api.github.com/users/AryanSharma9917/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AryanSharma9917/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AryanSharma9917/subscriptions",
"organizations_url": "https://api.github.com/users/AryanSharma9917/orgs",
"repos_url": "https://api.github.com/users/AryanSharma9917/repos",
"events_url": "https://api.github.com/users/AryanSharma9917/events{/privacy}",
"received_events_url": "https://api.github.com/users/AryanSharma9917/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
"content": "+1",
"created_at": "2023-08-27T08:06:28Z"
}
],
"timestamp": "2023-08-27T06:27:00Z",
"isReviewComment": true,
"pullRequestReviewId": 1597080706,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:46.645Z"
},
{
"repo": "rust-lang/rust",
"prNumber": 126077,
"prTitle": "Revert \"Use the HIR instead of mir_keys for determining whether something will have a MIR body.\"",
"prAuthor": "oli-obk",
"prLink": "https://github.com/rust-lang/rust/pull/126077",
"commentAuthor": "BoxyUwU",
"commentBody": "2 mono functions and one constant adds up to 3 items not 4 xd",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/rust-lang/rust/pull/126077#discussion_r1631363762",
"filePath": "tests/ui-fulldeps/stable-mir/check_instance.rs",
"diffHunk": "@@ -33,7 +33,7 @@ fn test_stable_mir() -> ControlFlow<()> {\n // Get all items and split generic vs monomorphic items.\n let (generic, mono): (Vec<_>, Vec<_>) =\n items.into_iter().partition(|item| item.requires_monomorphization());\n- assert_eq!(mono.len(), 3, \"Expected 2 mono functions and one constant\");\n+ assert_eq!(mono.len(), 4, \"Expected 2 mono functions and one constant\");",
"line": 5,
"reactionCount": 0,
"reactions": [
{
"id": 250766655,
"node_id": "REA_lATOAAsO6M5hPKKyzg7yZT8",
"user": {
"login": "oli-obk",
"id": 332036,
"node_id": "MDQ6VXNlcjMzMjAzNg==",
"avatar_url": "https://avatars.githubusercontent.com/u/332036?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/oli-obk",
"html_url": "https://github.com/oli-obk",
"followers_url": "https://api.github.com/users/oli-obk/followers",
"following_url": "https://api.github.com/users/oli-obk/following{/other_user}",
"gists_url": "https://api.github.com/users/oli-obk/gists{/gist_id}",
"starred_url": "https://api.github.com/users/oli-obk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oli-obk/subscriptions",
"organizations_url": "https://api.github.com/users/oli-obk/orgs",
"repos_url": "https://api.github.com/users/oli-obk/repos",
"events_url": "https://api.github.com/users/oli-obk/events{/privacy}",
"received_events_url": "https://api.github.com/users/oli-obk/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
"content": "laugh",
"created_at": "2024-06-07T16:11:20Z"
}
],
"timestamp": "2024-06-07T15:12:24Z",
"isReviewComment": true,
"pullRequestReviewId": 2104830067,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:50.603Z"
},
{
"repo": "rust-lang/rust",
"prNumber": 119074,
"prTitle": "Add new tier 3 aarch64-apple-watchos target",
"prAuthor": "leohowell",
"prLink": "https://github.com/rust-lang/rust/pull/119074",
"commentAuthor": "taiki-e",
"commentBody": "This is the wrong target name.\r\n\r\n```\r\n$ rustc --print cfg --target aarch64-apple-watchos\r\nerror: could not create LLVM TargetMachine for triple: aarch-apple-watcho: No available targets are compatible with triple \"aarch-apple-watchos\"\r\n```\r\n",
"commentBodyIncludesCodeSnippet": true,
"commentLink": "https://github.com/rust-lang/rust/pull/119074#discussion_r1433125930",
"filePath": "compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs",
"diffHunk": "@@ -0,0 +1,19 @@\n+use crate::spec::base::apple::{opts, Arch};\n+use crate::spec::{Target, TargetOptions};\n+\n+pub fn target() -> Target {\n+ let base = opts(\"watchos\", Arch::Arm64);\n+ Target {\n+ llvm_target: \"aarch-apple-watchos\".into(),",
"line": 7,
"reactionCount": 0,
"reactions": [],
"timestamp": "2023-12-20T19:54:45Z",
"isReviewComment": true,
"pullRequestReviewId": 1791569654,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:54.727Z"
},
{
"repo": "ggerganov/llama.cpp",
"prNumber": 6820,
"prTitle": "ggml : fix calloc argument ordering.",
"prAuthor": "airlied",
"prLink": "https://github.com/ggerganov/llama.cpp/pull/6820",
"commentAuthor": "compilade",
"commentBody": "I know this has already been merged, but I think this is was a typo\r\n```suggestion\r\n galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t));\r\n```",
"commentBodyIncludesCodeSnippet": true,
"commentLink": "https://github.com/ggerganov/llama.cpp/pull/6820#discussion_r1619368453",
"filePath": "ggml-alloc.c",
"diffHunk": "@@ -371,16 +371,16 @@ struct ggml_gallocr {\n };\n \n ggml_gallocr_t ggml_gallocr_new_n(ggml_backend_buffer_type_t * bufts, int n_bufs) {\n- ggml_gallocr_t galloc = (ggml_gallocr_t)calloc(sizeof(struct ggml_gallocr), 1);\n+ ggml_gallocr_t galloc = (ggml_gallocr_t)calloc(1, sizeof(struct ggml_gallocr));\n GGML_ASSERT(galloc != NULL);\n \n- galloc->bufts = calloc(sizeof(ggml_backend_buffer_type_t) * n_bufs, 1);\n+ galloc->bufts = calloc(n_bufs, sizeof(ggml_backend_buffer_type_t));\n GGML_ASSERT(galloc->bufts != NULL);\n \n- galloc->buffers = calloc(sizeof(ggml_backend_buffer_t) * n_bufs, 1);\n+ galloc->buffers = calloc(n_bufs, sizeof(ggml_backend_buffer_t) * n_bufs);",
"line": 13,
"reactionCount": 0,
"reactions": [],
"timestamp": "2024-05-29T19:19:27Z",
"isReviewComment": true,
"pullRequestReviewId": 2086213809,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:54:58.656Z"
},
{
"repo": "ggerganov/llama.cpp",
"prNumber": 2895,
"prTitle": "Update api_like_OAI.py",
"prAuthor": "superchargez",
"prLink": "https://github.com/ggerganov/llama.cpp/pull/2895",
"commentAuthor": "cebtenzzre",
"commentBody": "This code does nothing because it unsets the proxies and then immediately sets them back. The `requests` import is unnecessary, and makes this code less effective because `requests` probably reads those environment variables as soon as it is imported.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/ggerganov/llama.cpp/pull/2895#discussion_r1310537121",
"filePath": "examples/server/api_like_OAI.py",
"diffHunk": "@@ -1,4 +1,18 @@\n #!/usr/bin/env python3\n+import os\n+import requests\n+# Save original proxy settings\n+original_http_proxy = os.environ.get('http_proxy')\n+original_https_proxy = os.environ.get('https_proxy')\n+# Unset the proxies\n+os.environ['http_proxy'] = ''\n+os.environ['https_proxy'] = ''\n+# Reset the proxies to original values after your code\n+if original_http_proxy is not None:\n+ os.environ['http_proxy'] = original_http_proxy\n+if original_https_proxy is not None:\n+ os.environ['https_proxy'] = original_https_proxy",
"line": 14,
"reactionCount": 0,
"reactions": [],
"timestamp": "2023-08-30T16:27:39Z",
"isReviewComment": true,
"pullRequestReviewId": 1603090379,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:00.761Z"
},
{
"repo": "opencv/opencv",
"prNumber": 25084,
"prTitle": "Add compatibility with latest (3.1.54) emsdk version",
"prAuthor": "EDVTAZ",
"prLink": "https://github.com/opencv/opencv/pull/25084",
"commentAuthor": "opencv-alalek",
"commentBody": "`.format` can't handle `%s` because it uses `{}`",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/25084#discussion_r1710838120",
"filePath": "platforms/js/build_js.py",
"diffHunk": "@@ -256,7 +260,8 @@ def build_loader(self):\n help=\"Specify configuration file with own list of exported into JS functions\")\n parser.add_argument('--webnn', action=\"store_true\", help=\"Enable WebNN Backend\")\n \n- args = parser.parse_args()\n+ transformed_args = [\"--cmake_option=%s\".format(arg) if arg[:2] == \"-D\" else arg for arg in sys.argv[1:]]",
"line": 45,
"reactionCount": 0,
"reactions": [],
"timestamp": "2024-08-09T06:29:53Z",
"isReviewComment": true,
"pullRequestReviewId": 2229407704,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T01:00:31.791Z"
},
{
"repo": "opencv/opencv",
"prNumber": 22413,
"prTitle": "LevMarq: log level lowered",
"prAuthor": "savuor",
"prLink": "https://github.com/opencv/opencv/pull/22413",
"commentAuthor": "asmorkalov",
"commentBody": "In case if debug logs are disabled the macro is empty. You'll get something line if (settings.checkMinGradient && smallGradient); Please add {} for block to fix compiler warnings.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/22413#discussion_r952215737",
"filePath": "modules/3d/src/levmarq.cpp",
"diffHunk": "@@ -340,20 +340,20 @@ LevMarq::Report detail::LevMarqBase::optimize()\n \n bool found = (smallGradient || smallStep || smallEnergyDelta || smallEnergy);\n \n- CV_LOG_INFO(NULL, \"Finished: \" << (found ? \"\" : \"not \") << \"found\");\n+ CV_LOG_DEBUG(NULL, \"Finished: \" << (found ? \"\" : \"not \") << \"found\");\n std::string fr = \"Finish reason: \";\n if (settings.checkMinGradient && smallGradient)\n- CV_LOG_INFO(NULL, fr + \"gradient max val dropped below threshold\");\n+ CV_LOG_DEBUG(NULL, fr + \"gradient max val dropped below threshold\");",
"line": 96,
"reactionCount": 0,
"reactions": [],
"timestamp": "2022-08-23T06:51:02Z",
"isReviewComment": true,
"pullRequestReviewId": 1081559632,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:06.037Z"
},
{
"repo": "opencv/opencv",
"prNumber": 20881,
"prTitle": "Fixed issue #20880, QRDetect::searchHorizontalLines() boundary condition will skip the matched qrcode near the end",
"prAuthor": "flytogcp",
"prLink": "https://github.com/opencv/opencv/pull/20881",
"commentAuthor": "alalek",
"commentBody": "> pixels_position[i + 3]\r\n\r\nout of buffer access.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/20881#discussion_r729502817",
"filePath": "modules/objdetect/src/qrcode.cpp",
"diffHunk": "@@ -200,7 +200,7 @@ vector<Vec3d> QRDetect::searchHorizontalLines()\n }\n }\n pixels_position.push_back(width_bin_barcode - 1);\n- for (size_t i = 2; i < pixels_position.size() - 4; i+=2)\n+ for (size_t i = 2; i < pixels_position.size() - 2; i+=2)",
"line": 5,
"reactionCount": 0,
"reactions": [],
"timestamp": "2021-10-15T03:42:03Z",
"isReviewComment": true,
"pullRequestReviewId": 780442409,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:07.505Z"
},
{
"repo": "opencv/opencv",
"prNumber": 17995,
"prTitle": "Demo.py",
"prAuthor": "akchhayalok",
"prLink": "https://github.com/opencv/opencv/pull/17995",
"commentAuthor": "alalek",
"commentBody": "So, for Python 4.x it will not import anything.\r\nThis is wrong.\r\n\r\nWe should assume Python3 behavior.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/17995#discussion_r464579682",
"filePath": "samples/python/demo.py",
"diffHunk": "@@ -17,11 +17,15 @@\n from subprocess import Popen\n \n try:\n- import tkinter as tk # Python 3\n- from tkinter.scrolledtext import ScrolledText\n-except ImportError:\n- import Tkinter as tk # Python 2\n- from ScrolledText import ScrolledText\n+ if sys.version_info[0] == 3:\n+ import tkinter as tk # Python 3\n+ from tkinter.scrolledtext import ScrolledText #Python3\n+ elif sys.version_info[0] == 2:\n+ import Tkinter as tk #Python2\n+ from ScrolledText import ScrolledText #Python2\n+except ImportError as importerr:",
"line": 28,
"reactionCount": 0,
"reactions": [],
"timestamp": "2020-08-03T18:09:53Z",
"isReviewComment": true,
"pullRequestReviewId": 460238220,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:09.546Z"
},
{
"repo": "opencv/opencv",
"prNumber": 16291,
"prTitle": "ONNX graphs simplifier",
"prAuthor": "dkurt",
"prLink": "https://github.com/opencv/opencv/pull/16291",
"commentAuthor": "mshabunin",
"commentBody": "`axis` is not initialized here.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/16291#discussion_r366776427",
"filePath": "modules/dnn/src/onnx/onnx_graph_simplifier.cpp",
"diffHunk": "@@ -0,0 +1,157 @@\n+// This file is part of OpenCV project.\n+// It is subject to the license terms in the LICENSE file found in the top-level directory\n+// of this distribution and at http://opencv.org/license.html.\n+\n+// Copyright (C) 2020, Intel Corporation, all rights reserved.\n+// Third party copyrights are property of their respective owners.\n+\n+#include \"../precomp.hpp\"\n+\n+#include \"../graph_simplifier.hpp\"\n+#include \"onnx_graph_simplifier.hpp\"\n+\n+#include <queue>\n+\n+namespace cv { namespace dnn {\n+CV__DNN_EXPERIMENTAL_NS_BEGIN\n+\n+// This wrapper can behave differently for fake input nodes and real graph nodes.\n+class ONNXNodeWrapper : public ImportNodeWrapper\n+{\n+public:\n+ ONNXNodeWrapper(opencv_onnx::NodeProto* _node = 0) : node(_node) {}\n+\n+ virtual int getNumInputs() const CV_OVERRIDE\n+ {\n+ return node ? node->input_size() : 0;\n+ }\n+\n+ virtual std::string getInputName(int idx) const CV_OVERRIDE\n+ {\n+ CV_Assert_N(node, idx < node->input_size());\n+ return node->input(idx);\n+ }\n+\n+ virtual std::string getType() const CV_OVERRIDE\n+ {\n+ return node ? node->op_type() : \"\";\n+ }\n+\n+ virtual void setType(const std::string& type) CV_OVERRIDE\n+ {\n+ CV_Assert(node);\n+ node->set_op_type(type);\n+ }\n+\n+ virtual void setInputNames(const std::vector<std::string>& inputs) CV_OVERRIDE\n+ {\n+ CV_Assert(node);\n+ node->clear_input();\n+ for (int i = 0; i < inputs.size(); ++i)\n+ node->add_input(inputs[i]);\n+ }\n+\n+ opencv_onnx::NodeProto* node;\n+};\n+\n+// ONNX graph's inputs are separate from nodes so we index them before the rest of nodes.\n+class ONNXGraphWrapper : public ImportGraphWrapper\n+{\n+public:\n+ ONNXGraphWrapper(opencv_onnx::GraphProto& _net) : net(_net)\n+ {\n+ numInputs = net.input_size();\n+ }\n+\n+ virtual Ptr<ImportNodeWrapper> getNode(int idx) const CV_OVERRIDE\n+ {\n+ opencv_onnx::NodeProto* node = 0;\n+ if (idx >= numInputs)\n+ node = net.mutable_node(idx - numInputs);\n+ return makePtr<ONNXNodeWrapper>(node);\n+ }\n+\n+ virtual int getNumNodes() const CV_OVERRIDE\n+ {\n+ return numInputs + net.node_size();\n+ }\n+\n+ virtual std::string getNodeName(int idx) const CV_OVERRIDE\n+ {\n+ if (idx < numInputs)\n+ return net.input(idx).name();\n+ else\n+ return net.node(idx - numInputs).output(0);\n+ }\n+\n+ virtual void removeNode(int idx) CV_OVERRIDE\n+ {\n+ CV_Assert(idx >= numInputs);\n+ net.mutable_node()->DeleteSubrange(idx - numInputs, 1);\n+ }\n+\n+private:\n+ int numInputs;\n+ opencv_onnx::GraphProto& net;\n+};\n+\n+class SoftMaxSubgraph : public Subgraph\n+{\n+public:\n+ SoftMaxSubgraph()",
"line": 101,
"reactionCount": 0,
"reactions": [],
"timestamp": "2020-01-15T09:40:34Z",
"isReviewComment": true,
"pullRequestReviewId": 343090581,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:12.645Z"
},
{
"repo": "opencv/opencv",
"prNumber": 7937,
"prTitle": "Avoid segmentation fault in CommandLineParser::has",
"prAuthor": "SSteve",
"prLink": "https://github.com/opencv/opencv/pull/7937",
"commentAuthor": "alalek",
"commentBody": "It is better to replace `<=` to `<` instead.\r\n\r\nAlso please remove unnecessary commits from PR.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/7937#discussion_r94087860",
"filePath": "modules/core/src/command_line_parser.cpp",
"diffHunk": "@@ -9,6 +9,8 @@ static const char* noneValue = \"<none>\";\n \n static String cat_string(const String& str)\n {\n+ if (str.length() == 0)\n+ return String(\"\");\n int left = 0, right = (int)str.length();\n while( left <= right && str[left] == ' ' )",
"line": 7,
"reactionCount": 0,
"reactions": [],
"timestamp": "2016-12-28T23:18:47Z",
"isReviewComment": true,
"pullRequestReviewId": 14618513,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:14.755Z"
},
{
"repo": "opencv/opencv",
"prNumber": 7601,
"prTitle": "Add assertion to prevent processing of large images in remap",
"prAuthor": "sovrasov",
"prLink": "https://github.com/opencv/opencv/pull/7601",
"commentAuthor": "vpisarev",
"commentBody": "should it be `<` or `<=`?\n",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/7601#discussion_r86139965",
"filePath": "modules/imgproc/src/imgwarp.cpp",
"diffHunk": "@@ -4856,6 +4856,8 @@ void cv::remap( InputArray _src, OutputArray _dst,\n Mat src = _src.getMat(), map1 = _map1.getMat(), map2 = _map2.getMat();\n _dst.create( map1.size(), src.type() );\n Mat dst = _dst.getMat();\n+ CV_Assert( dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX );",
"line": 4,
"reactionCount": 0,
"reactions": [],
"timestamp": "2016-11-02T13:28:49Z",
"isReviewComment": true,
"pullRequestReviewId": 6811895,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:14.338Z"
},
{
"repo": "opencv/opencv",
"prNumber": 6895,
"prTitle": "Improved method for chessboard detection",
"prAuthor": "mshabunin",
"prLink": "https://github.com/opencv/opencv/pull/6895",
"commentAuthor": "alalek",
"commentBody": "`piAccumSum` is calculated, but not used anywhere.",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/6895#discussion_r190949439",
"filePath": "modules/calib3d/src/calibinit.cpp",
"diffHunk": "@@ -191,38 +195,204 @@ static void icvRemoveQuadFromGroup(CvCBQuad **quads, int count, CvCBQuad *q0);\n \n static int icvCheckBoardMonotony( CvPoint2D32f* corners, CvSize pattern_size );\n \n-#if 0\n-static void\n-icvCalcAffineTranf2D32f(CvPoint2D32f* pts1, CvPoint2D32f* pts2, int count, CvMat* affine_trans)\n+int cvCheckChessboardBinary(IplImage* src, CvSize size);\n+\n+/***************************************************************************************************/\n+//COMPUTE INTENSITY HISTOGRAM OF INPUT IMAGE\n+static int icvGetIntensityHistogram( unsigned char* pucImage, int iSizeCols, int iSizeRows, std::vector<int>& piHist );\n+//SMOOTH HISTOGRAM USING WINDOW OF SIZE 2*iWidth+1\n+static int icvSmoothHistogram( const std::vector<int>& piHist, std::vector<int>& piHistSmooth, int iWidth );\n+//COMPUTE FAST HISTOGRAM GRADIENT\n+static int icvGradientOfHistogram( const std::vector<int>& piHist, std::vector<int>& piHistGrad );\n+//PERFORM SMART IMAGE THRESHOLDING BASED ON ANALYSIS OF INTENSTY HISTOGRAM\n+static bool icvBinarizationHistogramBased( unsigned char* pucImg, int iCols, int iRows );\n+/***************************************************************************************************/\n+int icvGetIntensityHistogram( unsigned char* pucImage, int iSizeCols, int iSizeRows, std::vector<int>& piHist )\n {\n- int i, j;\n- int real_count = 0;\n- for( j = 0; j < count; j++ )\n+ int iVal;\n+\n+ // sum up all pixel in row direction and divide by number of columns\n+ for ( int j=0; j<iSizeRows; j++ )\n+ {\n+ for ( int i=0; i<iSizeCols; i++ )\n {\n- if( pts1[j].x >= 0 ) real_count++;\n+ iVal = (int)pucImage[j*iSizeCols+i];\n+ piHist[iVal]++;\n }\n- if(real_count < 3) return;\n- cv::Ptr<CvMat> xy = cvCreateMat( 2*real_count, 6, CV_32FC1 );\n- cv::Ptr<CvMat> uv = cvCreateMat( 2*real_count, 1, CV_32FC1 );\n- //estimate affine transfromation\n- for( i = 0, j = 0; j < count; j++ )\n+ }\n+ return 0;\n+}\n+/***************************************************************************************************/\n+int icvSmoothHistogram( const std::vector<int>& piHist, std::vector<int>& piHistSmooth, int iWidth )\n+{\n+ int iIdx;\n+ for ( int i=0; i<256; i++)\n+ {\n+ int iSmooth = 0;\n+ for ( int ii=-iWidth; ii<=iWidth; ii++)\n {\n- if( pts1[j].x >= 0 )\n- {\n- CV_MAT_ELEM( *xy, float, i*2+1, 2 ) = CV_MAT_ELEM( *xy, float, i*2, 0 ) = pts2[j].x;\n- CV_MAT_ELEM( *xy, float, i*2+1, 3 ) = CV_MAT_ELEM( *xy, float, i*2, 1 ) = pts2[j].y;\n- CV_MAT_ELEM( *xy, float, i*2, 2 ) = CV_MAT_ELEM( *xy, float, i*2, 3 ) = CV_MAT_ELEM( *xy, float, i*2, 5 ) = \\\n- CV_MAT_ELEM( *xy, float, i*2+1, 0 ) = CV_MAT_ELEM( *xy, float, i*2+1, 1 ) = CV_MAT_ELEM( *xy, float, i*2+1, 4 ) = 0;\n- CV_MAT_ELEM( *xy, float, i*2, 4 ) = CV_MAT_ELEM( *xy, float, i*2+1, 5 ) = 1;\n- CV_MAT_ELEM( *uv, float, i*2, 0 ) = pts1[j].x;\n- CV_MAT_ELEM( *uv, float, i*2+1, 0 ) = pts1[j].y;\n- i++;\n- }\n+ iIdx = i+ii;\n+ if (iIdx > 0 && iIdx < 256)\n+ {\n+ iSmooth += piHist[iIdx];\n+ }\n+ }\n+ piHistSmooth[i] = iSmooth/(2*iWidth+1);\n+ }\n+ return 0;\n+}\n+/***************************************************************************************************/\n+int icvGradientOfHistogram( const std::vector<int>& piHist, std::vector<int>& piHistGrad )\n+{\n+ piHistGrad[0] = 0;\n+ for ( int i=1; i<255; i++)\n+ {\n+ piHistGrad[i] = piHist[i-1] - piHist[i+1];\n+ if ( abs(piHistGrad[i]) < 100 )\n+ {\n+ if ( piHistGrad[i-1] == 0)\n+ piHistGrad[i] = -100;\n+ else\n+ piHistGrad[i] = piHistGrad[i-1];\n+ }\n+ }\n+ return 0;\n+}\n+/***************************************************************************************************/\n+bool icvBinarizationHistogramBased( unsigned char* pucImg, int iCols, int iRows )\n+{\n+ int iMaxPix = iCols*iRows;\n+ int iMaxPix1 = iMaxPix/100;\n+ const int iNumBins = 256;\n+ std::vector<int> piHistIntensity(iNumBins, 0);\n+ std::vector<int> piHistSmooth(iNumBins, 0);\n+ std::vector<int> piHistGrad(iNumBins, 0);\n+ std::vector<int> piAccumSum(iNumBins, 0);",
"line": 135,
"reactionCount": 0,
"reactions": [],
"timestamp": "2018-05-25T16:41:24Z",
"isReviewComment": true,
"pullRequestReviewId": 123440475,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:16.642Z"
},
{
"repo": "opencv/opencv",
"prNumber": 6787,
"prTitle": "Implemented mouse wheel callback support for Linux",
"prAuthor": "theg4sh",
"prLink": "https://github.com/opencv/opencv/pull/6787",
"commentAuthor": "ilya-lavrenov",
"commentBody": "`mouse_wheel` is undeclared identifier. @theg4sh, have you ever tested this code?\n",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/6787#discussion_r71543409",
"filePath": "modules/highgui/src/window_QT.cpp",
"diffHunk": "@@ -2629,8 +2629,18 @@ void DefaultViewPort::resizeEvent(QResizeEvent* evnt)\n \n void DefaultViewPort::wheelEvent(QWheelEvent* evnt)\n {\n- scaleView(evnt->delta() / 240.0, evnt->pos());\n+ int delta = evnt->delta();\n+ int cv_event = -1;\n+ int flags = ((delta & 0xffff)<<16) | ((evnt->orientation() == Qt::Vertical) ? CV_EVENT_MOUSEWHEEL : CV_EVENT_MOUSEHWHEEL);\n+ QPoint pt = evnt->pos();\n+\n+ icvmouseHandler(evnt, mouse_wheel, cv_event, flags);",
"line": 10,
"reactionCount": 0,
"reactions": [],
"timestamp": "2016-07-20T15:07:14Z",
"isReviewComment": true,
"pullRequestReviewId": null,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:16.826Z"
},
{
"repo": "opencv/opencv",
"prNumber": 5548,
"prTitle": "update python features2d tutorials",
"prAuthor": "berak",
"prLink": "https://github.com/opencv/opencv/pull/5548",
"commentAuthor": "StevenPuttemans",
"commentBody": "You are initiating a STAR detector below but calling it a FAST detector?\n",
"commentBodyIncludesCodeSnippet": false,
"commentLink": "https://github.com/opencv/opencv/pull/5548#discussion_r42601447",
"filePath": "doc/py_tutorials/py_feature2d/py_brief/py_brief.markdown",
"diffHunk": "@@ -55,11 +57,11 @@ from matplotlib import pyplot as plt\n \n img = cv2.imread('simple.jpg',0)\n \n-# Initiate STAR detector\n-star = cv2.FeatureDetector_create(\"STAR\")\n+# Initiate FAST detector",
"line": 15,
"reactionCount": 0,
"reactions": [],
"timestamp": "2015-10-21T09:29:04Z",
"isReviewComment": true,
"pullRequestReviewId": null,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:18.599Z"
},
{
"repo": "opencv/opencv",
"prNumber": 3640,
"prTitle": "Memory snapshots",
"prAuthor": "BloodAxe",
"prLink": "https://github.com/opencv/opencv/pull/3640",
"commentAuthor": "mshabunin",
"commentBody": "This line causes build error with GCC:\n\n```\nalloc.cpp:103:16: error: ‘move’ is not a member of ‘std’\n return std::move(snapshot);\n ^\n```\n",
"commentBodyIncludesCodeSnippet": true,
"commentLink": "https://github.com/opencv/opencv/pull/3640#discussion_r23516658",
"filePath": "modules/core/src/alloc.cpp",
"diffHunk": "@@ -41,12 +41,111 @@\n //M*/\n \n #include \"precomp.hpp\"\n+#include <map>\n+#include <memory>\n \n #define CV_USE_SYSTEM_MALLOC 1\n \n namespace cv\n {\n \n+class MemoryManager\n+{\n+public:\n+ typedef std::map<void*, size_t> AllocationTable;\n+ typedef cv::AutoLock LockType;\n+\n+ void recordAlloc(void* ptr, size_t size)\n+ {\n+ LockType guard(mAllocMutex);\n+ mAllocatedMemory.insert(std::make_pair(ptr, size));\n+\n+ mCurrentMemoryUsage += size;\n+ mPeakMemoryUsage = std::max(mPeakMemoryUsage, mCurrentMemoryUsage);\n+ mPeakMemoryUsageSinceLastSnapshot = std::max(mPeakMemoryUsageSinceLastSnapshot, mCurrentMemoryUsage);\n+ mAllocationsCount++;\n+ }\n+\n+ void recordFree(void* ptr)\n+ {\n+ LockType guard(mAllocMutex);\n+\n+ AllocationTable::iterator block = mAllocatedMemory.find(ptr);\n+ CV_Assert(block != mAllocatedMemory.end());\n+\n+ mCurrentMemoryUsage -= block->second;\n+ mDeallocationsCount++;\n+ mAllocatedMemory.erase(block);\n+ }\n+\n+ static MemoryManager& Instance()\n+ {\n+ createMemoryManager();\n+\n+ MemoryManager& mgr = const_cast<MemoryManager&>(*mInstance);\n+ return mgr;\n+ }\n+\n+ MemorySnapshot makeSnapshot()\n+ {\n+ LockType guard(mAllocMutex);\n+\n+ MemorySnapshot snapshot;\n+ snapshot.peakMemoryUsage = mPeakMemoryUsage;\n+ snapshot.peakMemoryUsageSinceLastSnapshot = mPeakMemoryUsageSinceLastSnapshot;\n+ snapshot.allocatedMemory = mCurrentMemoryUsage;\n+ snapshot.allocationsCount = mAllocationsCount;\n+ snapshot.deallocationsCount = mDeallocationsCount;\n+ snapshot.liveObjects = mAllocationsCount - mDeallocationsCount;\n+\n+ mPeakMemoryUsageSinceLastSnapshot = 0;\n+\n+ return std::move(snapshot);",
"line": 63,
"reactionCount": 0,
"reactions": [],
"timestamp": "2015-01-26T08:30:24Z",
"isReviewComment": true,
"pullRequestReviewId": null,
"LLMReviewed": true,
"LLMReviewPassed": true,
"reReviewedAfterJan27th": true,
"difficultyLevel": "easy",
"difficultyAssessedAt": "2025-02-27T02:55:20.992Z"
},
{
"repo": "opencv/opencv",
"prNumber": 2420,
"prTitle": "About changes in \"cpp\" file. I think, that author had in mind that: if w...",