# \#transducers

**URL:** https://discourse.julialang.org/tag/transducers/716.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Solving this without a loop (learning purposes)](https://discourse.julialang.org/t/solving-this-without-a-loop-learning-purposes/103013)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 14\
**Last updated:** [August 21, 2023, 12:46am UTC](https://discourse.julialang.org/t/solving-this-without-a-loop-learning-purposes/103013 "2023-08-21T00:46:23Z")

</div>

I’m trying to get more familiar with using Transducers.jl or related functions that avoid loops - just to learn. Let’s say I have this simple vector x = Bool\[1,1,0,0,1,1,0,1\] and I want to find the indices of adjacent …

---

## [Transducers vs Iterators](https://discourse.julialang.org/t/transducers-vs-iterators/98771)

<div class="topic-metadata">

**Author:** [@jekyllstein](https://discourse.julialang.org/u/jekyllstein)\
**Replies:** 0\
**Last updated:** [May 12, 2023, 11:03pm UTC](https://discourse.julialang.org/t/transducers-vs-iterators/98771 "2023-05-12T23:03:42Z")

</div>

I have an example of a simple processing pipeline where I noticed Transducers.jl was making a lot of allocations and behaving slowly compared to compositing iterators and generators together. I’m wondering if there’s a …

---

## [Materialize transducer into existing storage](https://discourse.julialang.org/t/materialize-transducer-into-existing-storage/87258)

<div class="topic-metadata">

**Author:** [@mfiano](https://discourse.julialang.org/u/mfiano)\
**Replies:** 4\
**Last updated:** [September 14, 2022, 2:38pm UTC](https://discourse.julialang.org/t/materialize-transducer-into-existing-storage/87258 "2022-09-14T14:38:00Z")

</div>

I defined a reducible for my Kernel type, which works fine, and I can materialize pipelines with collect, etc. I now want to be able to write a function that does kernel |\> Map(func) |\> # ... materialize into existing v…

---

## [Getting first element of a possibly empty Eduction (Transducers.jl)](https://discourse.julialang.org/t/getting-first-element-of-a-possibly-empty-eduction-transducers-jl/86932)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 0\
**Last updated:** [September 8, 2022, 9:54am UTC](https://discourse.julialang.org/t/getting-first-element-of-a-possibly-empty-eduction-transducers-jl/86932 "2022-09-08T09:54:17Z")

</div>

Consider the following eduction julia\> using Transducers julia\> ed = (rand() for i in 1:10) |\> Filter(\<(0.1)) Base.Generator{UnitRange{Int64}, var"#1#2"} |\> Filter(Fix2) Getting the first element is tricky becau…

---

## [Sparse syrk() routine using Transducers.jl](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 0\
**Last updated:** [August 23, 2022, 7:09pm UTC](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218 "2022-08-23T19:09:07Z")

</div>

Hi, I implemented a sparse syrk routine to see if I could get something faster than the naive implementation: using SparseArrays using LinearAlgebra using Transducers using Combinatorics naive\_spsyrk(s) = Symmetric(s …

---

## [How to write nested reducibles in Transducers.jl](https://discourse.julialang.org/t/how-to-write-nested-reducibles-in-transducers-jl/84199)

<div class="topic-metadata">

**Author:** [@nielsls](https://discourse.julialang.org/u/nielsls)\
**Replies:** 0\
**Last updated:** [July 13, 2022, 9:44pm UTC](https://discourse.julialang.org/t/how-to-write-nested-reducibles-in-transducers-jl/84199 "2022-07-13T21:44:32Z")

</div>

Writing reducibles · Transducers.jl describes how to make a non-iterable collection reducible; e.g. how to use it as input to transducers. But it does not describe how to delegate the reducing operation to another reduci…

---

## [Transducers/FLoops equivalent for mapreduce with dims arg (on GPU)](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 9\
**Last updated:** [May 12, 2022, 7:41pm UTC](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767 "2022-05-12T19:41:30Z")

</div>

Hi all, Is it possible to write an equivalent of mapreduce(; dims) using either Transducers or FLoops? I’m interested in the NVidia GPU context. I want to do something like: julia\> begin using CUDA, LazyArrays …

---

## [How Transducers.jl process table?](https://discourse.julialang.org/t/how-transducers-jl-process-table/80737)

<div class="topic-metadata">

**Author:** [@zsz00](https://discourse.julialang.org/u/zsz00)\
**Replies:** 7\
**Last updated:** [May 11, 2022, 10:19am UTC](https://discourse.julialang.org/t/how-transducers-jl-process-table/80737 "2022-05-11T10:19:03Z")

</div>

How Transducers.jl process table? get each column mean ? using Transducers, Table, Statistics N = 1\_000\_000 a = \[2randn(N÷2) .+ 6; randn(N÷2)\] b = \[3randn(N÷2); 2randn(N÷2)\] c = randn(N) d = c .+ 0.6randn(N) table = (;…

---

## [Parallel simulation : coroutine vs multi-threading](https://discourse.julialang.org/t/parallel-simulation-coroutine-vs-multi-threading/73466)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 4\
**Last updated:** [December 22, 2021, 10:00pm UTC](https://discourse.julialang.org/t/parallel-simulation-coroutine-vs-multi-threading/73466 "2021-12-22T22:00:40Z")

</div>

Hi, community! I’m usually using DiffEq.jl to perform dynamical system simulation. To perform simulation with multiple conditions simultaneously (to reduce the overall wall time), I often use multi-threading via Transdu…

---

## [PartitionBy, retaining key](https://discourse.julialang.org/t/partitionby-retaining-key/62820)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 4\
**Last updated:** [June 16, 2021, 6:28am UTC](https://discourse.julialang.org/t/partitionby-retaining-key/62820 "2021-06-16T06:28:17Z")

</div>

Is there something like Python’s itertools.groupby, which is like Julia’s Transducers.PartitionBy but yields (partition\_key, partition\_entries) pairs instead of only partition entries? cc @tkf

---

## [Could Transducers help here?](https://discourse.julialang.org/t/could-transducers-help-here/19986)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 4\
**Last updated:** [January 23, 2019, 9:02pm UTC](https://discourse.julialang.org/t/could-transducers-help-here/19986 "2019-01-23T21:02:00Z")

</div>

I’m trying to get a finer understanding of where Transducers.jl can help, especially by comparison to explicit loops and iterators. Here is a small example (freely adapted from advent of code, day 6, part2). A version …
