Skip to content

Commit 1bfb420

Browse files
committed
comment cleanup
1 parent 9c6c151 commit 1bfb420

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/dtype_next/image_processing_with_tensors.clj

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ writable-buffer
372372

373373
;; `tensor/mget` reads a single element at given indices:
374374

375-
(tensor/mget toy-tensor 1 2) ; row 1, column 2 → 12
375+
(tensor/mget toy-tensor 1 2)
376376

377377
;; ## Slicing Dimensions: tensor/slice and tensor/slice-right
378378

@@ -470,13 +470,13 @@ toy-cols
470470

471471
;; **Reduction operations** (collapse dimensions):
472472

473-
(dfn/mean small-tensor) ; mean of all elements
473+
(dfn/mean small-tensor)
474474

475-
(dfn/reduce-max small-tensor) ; maximum value
475+
(dfn/reduce-max small-tensor)
476476

477-
(dfn/reduce-min small-tensor) ; minimum value
477+
(dfn/reduce-min small-tensor)
478478

479-
(dfn/sum small-tensor) ; sum of all elements
479+
(dfn/sum small-tensor)
480480

481481
;; **Why dfn instead of regular Clojure functions?**
482482
;; - Work on entire tensors efficiently (no boxing)
@@ -503,7 +503,8 @@ toy-cols
503503
(dfn/* 2.5) ; compute
504504
(dfn/min 255) ; clamp to valid range
505505
(dfn/max 0)
506-
(dtype/elemwise-cast :uint8)) ; downcast back
506+
(dtype/elemwise-cast :uint8) ; downcast back
507+
)
507508

508509
;; ## Shape Operations: dtype/shape and tensor/reshape
509510

@@ -870,13 +871,13 @@ edges
870871

871872
;; Shape changed from [H W C] to [W H C]:
872873

873-
(dtype/shape img-transposed) ; [1280 960 3]
874+
(dtype/shape img-transposed)
874875

875876
;; Now we can slice columns:
876877

877878
(def img-columns (tensor/slice img-transposed 1))
878879

879-
(dtype/ecount img-columns) ; 1280 columns
880+
(dtype/ecount img-columns)
880881

881882
;; Compute column brightness (horizontal profile):
882883

@@ -915,7 +916,8 @@ edges
915916
(def row-means-fast
916917
(-> original-tensor
917918
(tensor/reduce-axis dfn/mean 1 :float64) ; [H W C] → [H C]
918-
(tensor/reduce-axis dfn/mean 1 :float64))) ; [H C] → [H]
919+
(tensor/reduce-axis dfn/mean 1 :float64)) ; [H C] → [H]
920+
)
919921

920922
;; First 10 values (compare with earlier slice-based approach):
921923

@@ -950,7 +952,8 @@ edges
950952

951953
;; Brightness map shape:
952954

953-
(dtype/shape brightness-map) ; [48 64] for 960/20 × 1280/20
955+
(dtype/shape brightness-map)
956+
;; [48 64] for 960/20 × 1280/20
954957

955958
;; Find brightest and darkest blocks:
956959

0 commit comments

Comments
 (0)