# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1335

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

**Page:** 1336

---

## [LoopVectorization almost doubles execution time?](https://discourse.julialang.org/t/loopvectorization-almost-doubles-execution-time/64333)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 6\
**Last updated:** [July 9, 2021, 4:28pm UTC](https://discourse.julialang.org/t/loopvectorization-almost-doubles-execution-time/64333 "2021-07-09T16:28:58Z")

</div>

Hi everyone, I am testing LoopVectorization in my program and since it did not produce any change in speed, I boiled it down to an exemplary function. Here I found something which puzzled me because although the functio…

---

## [Kernel optimization and shared memory](https://discourse.julialang.org/t/kernel-optimization-and-shared-memory/64362)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 1\
**Last updated:** [July 9, 2021, 4:02pm UTC](https://discourse.julialang.org/t/kernel-optimization-and-shared-memory/64362 "2021-07-09T16:02:47Z")

</div>

Hi, I try to optimize the following kernel using CUDA function kernel(A,B) index = (blockIdx().x - 1) \* blockDim().x + threadIdx().x stride = blockDim().x \* gridDim().x for i in index:stride:size(A,…

---

## [Simple question about Array and Subarrays](https://discourse.julialang.org/t/simple-question-about-array-and-subarrays/64346)

<div class="topic-metadata">

**Author:** [@RCHG](https://discourse.julialang.org/u/RCHG)\
**Replies:** 5\
**Last updated:** [July 9, 2021, 4:00pm UTC](https://discourse.julialang.org/t/simple-question-about-array-and-subarrays/64346 "2021-07-09T16:00:05Z")

</div>

Let’s say that for a given dimension d, we need to constrain the matrix to an specific value (or index). In other words, we need the subarray in which that dimension has an specific value (or index). How I can do someth…

---

## [Parameters not updating in Flux](https://discourse.julialang.org/t/parameters-not-updating-in-flux/64208)

<div class="topic-metadata">

**Author:** [@a-ill](https://discourse.julialang.org/u/a-ill)\
**Replies:** 20\
**Last updated:** [July 9, 2021, 3:11pm UTC](https://discourse.julialang.org/t/parameters-not-updating-in-flux/64208 "2021-07-09T15:11:12Z")

</div>

I have the following custom layer. struct Activation{F} f::F Activation(f::Function) = new{typeof(f)}(f) end (m::Activation)(x::AbstractArray) = m.f.(x) I test whether it allows a model to be trained using the …

---

## [Error in Using "@threads"](https://discourse.julialang.org/t/error-in-using-threads/64290)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 18\
**Last updated:** [July 9, 2021, 3:10pm UTC](https://discourse.julialang.org/t/error-in-using-threads/64290 "2021-07-09T15:10:51Z")

</div>

Hello, I have a julia file called “makeNetlistTest.jl” which calls function “DefineYnImproved()” and basically the execution works properly. However, when I am trying to use “@threads” before the “for loop” in function…

---

## [A good way of checking whether a keyword argument is present](https://discourse.julialang.org/t/a-good-way-of-checking-whether-a-keyword-argument-is-present/64199)

<div class="topic-metadata">

**Author:** [@Jan\_Dolinsky](https://discourse.julialang.org/u/Jan_Dolinsky)\
**Replies:** 7\
**Last updated:** [July 9, 2021, 3:10pm UTC](https://discourse.julialang.org/t/a-good-way-of-checking-whether-a-keyword-argument-is-present/64199 "2021-07-09T15:10:24Z")

</div>

Hello, I\`d like to check for a presence of a particular keyword argument. I wanted to cross-check whether I am doing the right thing here. This works but I feel using “filter” is perhaps an overkill and there might be …

---

## [How to distribute several tasks writing on common variable?](https://discourse.julialang.org/t/how-to-distribute-several-tasks-writing-on-common-variable/64359)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 0\
**Last updated:** [July 9, 2021, 2:54pm UTC](https://discourse.julialang.org/t/how-to-distribute-several-tasks-writing-on-common-variable/64359 "2021-07-09T14:54:48Z")

</div>

Hello, I need to distribute several tasks (writing on the same variable) on several workers, and I dont know how to do that: #Task-1 if ~isempty(x1) for i in 1:size(x1,2) Y\[i,i\] += x1\[i\]; e…

---

## [Question for lower performance by using @threads in for loop](https://discourse.julialang.org/t/question-for-lower-performance-by-using-threads-in-for-loop/64315)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 13\
**Last updated:** [July 9, 2021, 2:37pm UTC](https://discourse.julialang.org/t/question-for-lower-performance-by-using-threads-in-for-loop/64315 "2021-07-09T14:37:17Z")

</div>

Hello, I am surprised that when using the below code, I have the following execution time: using .Threads n=10000; s=1 Y=zeros(n,n); @time begin for i in 1:n for m in 1:30 if s == 1 …

---

## [Container type declaration when computing equivalence classes for performance vs genericity](https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 1\
**Last updated:** [July 9, 2021, 2:30pm UTC](https://discourse.julialang.org/t/container-type-declaration-when-computing-equivalence-classes-for-performance-vs-genericity/64353 "2021-07-09T14:30:30Z")

</div>

It is advised in the performance section of the documentation that container type should not be AbstractType for better performance. I wonder what is the correct way to declare container partition, data in the following …

---

## [Need help with highest posterior density interval plot using Makie](https://discourse.julialang.org/t/need-help-with-highest-posterior-density-interval-plot-using-makie/64320)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 1:43pm UTC](https://discourse.julialang.org/t/need-help-with-highest-posterior-density-interval-plot-using-makie/64320 "2021-07-09T13:43:15Z")

</div>

I am trying to create the highest posterior density interval plot, but haven’t been able to create the one where the HDPI region is shaded and follows the density curve. p\_grid = range(0,stop=1,length=1000) prior = fill…

---

## [\[ANN\] KeywordCalls.jl](https://discourse.julialang.org/t/ann-keywordcalls-jl/60266)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 9\
**Last updated:** [July 9, 2021, 1:42pm UTC](https://discourse.julialang.org/t/ann-keywordcalls-jl/60266 "2021-07-09T13:42:40Z")

</div>

I’m happy to announce KeywordCalls.jl. Registration is pending. This problem comes up in Soss.jl and MeasureTheory.jl, so I hope making it a general-use package might also be helpful to others. From the README KeywordC…

---

## ["Nightly" allocates but 1.6 doesn't](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 3\
**Last updated:** [July 9, 2021, 1:27pm UTC](https://discourse.julialang.org/t/nightly-allocates-but-1-6-doesnt/64118 "2021-07-09T13:27:35Z")

</div>

In KeywordCalls.jl we have some tests like this: @testset "No Allocation" begin @test 0 == @ballocated f(a=1, b=2, c=3) @test 0 == @ballocated f((a=1, b=2, c=3)) @test 0 == @ballocat…

---

## [RegisterWindowMessage and SendMessage](https://discourse.julialang.org/t/registerwindowmessage-and-sendmessage/64299)

<div class="topic-metadata">

**Author:** [@crivens](https://discourse.julialang.org/u/crivens)\
**Replies:** 3\
**Last updated:** [July 9, 2021, 1:16pm UTC](https://discourse.julialang.org/t/registerwindowmessage-and-sendmessage/64299 "2021-07-09T13:16:52Z")

</div>

Hey there! Some background so you can better answer my question: I’m a beginner in Julia (with a long background in hobbyist coding in various languages). I set myself to learn the language by creating an automation mo…

---

## [Declarative ylims!](https://discourse.julialang.org/t/declarative-ylims/62504)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 10\
**Last updated:** [July 9, 2021, 1:15pm UTC](https://discourse.julialang.org/t/declarative-ylims/62504 "2021-07-09T13:15:29Z")

</div>

f = draw(layers) ylims!(f.grid\[1,1\].axis, -.4, .4) Is there a declarative way to set the axis limits using the draw function?

---

## [Free an unregistered package?](https://discourse.julialang.org/t/free-an-unregistered-package/26062)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 5\
**Last updated:** [July 9, 2021, 12:57pm UTC](https://discourse.julialang.org/t/free-an-unregistered-package/26062 "2021-07-09T12:57:23Z")

</div>

When I dev a local, unregistered package (a Git repo), I don’t see a way to free it. Here’s what I tried: \]add C:\\\\Users\\\\Tucker\\\\Desktop\\\\julia-tests\\\\ANewPackage\\\\ \]dev ANewPackage ERROR: The following package names…

---

## [Custom module to import, manipulate and export dataframes issue](https://discourse.julialang.org/t/custom-module-to-import-manipulate-and-export-dataframes-issue/64309)

<div class="topic-metadata">

**Author:** [@Mitch](https://discourse.julialang.org/u/Mitch)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 12:29pm UTC](https://discourse.julialang.org/t/custom-module-to-import-manipulate-and-export-dataframes-issue/64309 "2021-07-09T12:29:25Z")

</div>

Hi, thank you for your help! I built a module to subset a broader dataframe into smaller dataframes: MWE below. module df\_prep using Pkg Pkg.add("DataFrames") using DataFrames function df\_preps(df1::DataFrame) expo…

---

## [Flux: Resample model with different initializations](https://discourse.julialang.org/t/flux-resample-model-with-different-initializations/59097)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 9\
**Last updated:** [July 9, 2021, 12:22pm UTC](https://discourse.julialang.org/t/flux-resample-model-with-different-initializations/59097 "2021-07-09T12:22:38Z")

</div>

Hi, I want to do an experiment in Flux where I want to keep the architecture of the model same and want to initialize the parameters with different variance normal distributions. My current set up looks like this funct…

---

## [Help with Pkg Error in Julia 1.6.1 (windows)](https://discourse.julialang.org/t/help-with-pkg-error-in-julia-1-6-1-windows/64265)

<div class="topic-metadata">

**Author:** [@Rodrigo\_B](https://discourse.julialang.org/u/Rodrigo_B)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 12:19pm UTC](https://discourse.julialang.org/t/help-with-pkg-error-in-julia-1-6-1-windows/64265 "2021-07-09T12:19:48Z")

</div>

Dear Community, would like to request your help with the following error. Recently I installed Julia 1.6.1 in a windows machine, and for some strange reason the Pkg.add(…) throws the following error: ERROR: KeyError…

---

## [Gathering monomial coefficients of orthogonal polynomials using SpecialPolynomials.jl](https://discourse.julialang.org/t/gathering-monomial-coefficients-of-orthogonal-polynomials-using-specialpolynomials-jl/63554)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 34\
**Last updated:** [July 9, 2021, 11:56am UTC](https://discourse.julialang.org/t/gathering-monomial-coefficients-of-orthogonal-polynomials-using-specialpolynomials-jl/63554 "2021-07-09T11:56:23Z")

</div>

While using SpecialPolynomials.jl I want to gather the monomial coefficients of multiple orthogonal polynomials of increasing size in a matrix. My current implementation is using LinearAlgebra,SpecialPolynomials,Polyno…

---

## [Julia equivalent of scipy binned\_statistic\_dd](https://discourse.julialang.org/t/julia-equivalent-of-scipy-binned-statistic-dd/64260)

<div class="topic-metadata">

**Author:** [@jpmorr](https://discourse.julialang.org/u/jpmorr)\
**Replies:** 4\
**Last updated:** [July 9, 2021, 11:06am UTC](https://discourse.julialang.org/t/julia-equivalent-of-scipy-binned-statistic-dd/64260 "2021-07-09T11:06:23Z")

</div>

I’m a python user and I’ve just started experimenting with julia to see if it is as quick as I keep reading. I’m usually dealing with 3D data and one of the most frequently used functions in my workflow is SciPy’s (binn…

---

## [Val type is type unstable?](https://discourse.julialang.org/t/val-type-is-type-unstable/64336)

<div class="topic-metadata">

**Author:** [@shamazmazum](https://discourse.julialang.org/u/shamazmazum)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 10:34am UTC](https://discourse.julialang.org/t/val-type-is-type-unstable/64336 "2021-07-09T10:34:06Z")

</div>

Hello, should I be afraid of ::Val{\_A} where \_A in this situation? f(x, y, ::Val{:x}) = x f(x, y, ::Val{:y}) = y f(x, y, s :: Symbol) = f(x, y, Val(s)) @code\_warntype f(1,2,:x) Variables #self#::Core.Const(f) x::I…

---

## [How to solve ERROR: TypeError: in keyword argument precompile\_statements\_file?](https://discourse.julialang.org/t/how-to-solve-error-typeerror-in-keyword-argument-precompile-statements-file/64339)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 0\
**Last updated:** [July 9, 2021, 10:24am UTC](https://discourse.julialang.org/t/how-to-solve-error-typeerror-in-keyword-argument-precompile-statements-file/64339 "2021-07-09T10:24:17Z")

</div>

Hi, When I try to push my app to heroku, I am getting following error when I try to push ERROR: TypeError: in keyword argument precompile\_statements\_file, expected Union{String, Vector{String}}, got a value of type No…

---

## [AlgebraOfGraphics.jl: Combine mappings & data with different unnamed arguments](https://discourse.julialang.org/t/algebraofgraphics-jl-combine-mappings-data-with-different-unnamed-arguments/64258)

<div class="topic-metadata">

**Author:** [@behinger](https://discourse.julialang.org/u/behinger)\
**Replies:** 4\
**Last updated:** [July 8, 2021, 8:52pm UTC](https://discourse.julialang.org/t/algebraofgraphics-jl-combine-mappings-data-with-different-unnamed-arguments/64258 "2021-07-08T20:52:25Z")

</div>

I want to share some mappings (e.g. color, col) between two datasets and two visuals, but the number of unnamed inputs to the visuals is different. A simplified version without any shared mappings: d1 = (;segments=\[Rect…

---

## [CSV reading in mutable struct error reading Int as string](https://discourse.julialang.org/t/csv-reading-in-mutable-struct-error-reading-int-as-string/64323)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 3\
**Last updated:** [July 9, 2021, 8:51am UTC](https://discourse.julialang.org/t/csv-reading-in-mutable-struct-error-reading-int-as-string/64323 "2021-07-09T08:51:56Z")

</div>

Hi All, While putting csv data in a struct getting the error for the below. localpath = string("D:\\\\crane\_intensity\\\\") mutable struct GeneralDetail B::UInt8 C::UInt8 P::UInt8 T::UInt8 Cs\_m::Array{UInt8,…

---

## [\[ANN\] Scanf 0.3](https://discourse.julialang.org/t/ann-scanf-0-3/64216)

<div class="topic-metadata">

**Author:** [@klacru](https://discourse.julialang.org/u/klacru)\
**Replies:** 0\
**Last updated:** [July 7, 2021, 2:19pm UTC](https://discourse.julialang.org/t/ann-scanf-0-3/64216 "2021-07-07T14:19:44Z")

</div>

Scanf is the C-style of io-stream formatted reading. This version provides most features of standard scanf C function family. Scanf.jl example usage: julia\> using Scanf julia\> r, a, b, c, d = @scanf "42 -infABCDE he…

---

## [User-defined objective function with scalar and vector inputs](https://discourse.julialang.org/t/user-defined-objective-function-with-scalar-and-vector-inputs/64218)

<div class="topic-metadata">

**Author:** [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Replies:** 5\
**Last updated:** [July 9, 2021, 5:12am UTC](https://discourse.julialang.org/t/user-defined-objective-function-with-scalar-and-vector-inputs/64218 "2021-07-09T05:12:01Z")

</div>

Hello, I am using Ipopt to write an optimization problem with a user-defined objective function that has 5 scalar inputs and one vector input. I define the objective function as likelihood((ρ,α,fB,fS,fO,δ…), where δ is …

---

## [JuMP Ipopt performance for MLE](https://discourse.julialang.org/t/jump-ipopt-performance-for-mle/64295)

<div class="topic-metadata">

**Author:** [@mengxiaoliu](https://discourse.julialang.org/u/mengxiaoliu)\
**Replies:** 1\
**Last updated:** [July 9, 2021, 5:10am UTC](https://discourse.julialang.org/t/jump-ipopt-performance-for-mle/64295 "2021-07-09T05:10:26Z")

</div>

Hello, With much of your help, I am finally able to write a functioning code file. However, I was not able to find enough resources online for tuning the performance of Ipopt in JuMP. Now I would like to seek your advi…

---

## [Weight regularisation which iterates params(m) in Flux -- Mutating arrays is not supported](https://discourse.julialang.org/t/weight-regularisation-which-iterates-params-m-in-flux-mutating-arrays-is-not-supported/64314)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 7\
**Last updated:** [July 9, 2021, 4:42am UTC](https://discourse.julialang.org/t/weight-regularisation-which-iterates-params-m-in-flux-mutating-arrays-is-not-supported/64314 "2021-07-09T04:42:08Z")

</div>

I’m trying to implement weight regularisation which requires adding a weight-dependent penalty to the loss function. When I proceed naively, I run into “Mutating arrays is not supported” but I don’t understand what array…

---

## [Detect possible exceptions](https://discourse.julialang.org/t/detect-possible-exceptions/64304)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 2:55am UTC](https://discourse.julialang.org/t/detect-possible-exceptions/64304 "2021-07-09T02:55:17Z")

</div>

Suppose I want to have more confidence about the control flow in part of my program. Is it possible to detect what exceptions a function might throw? E.g. is that something JET can do? @aviatesk

---

## [Convert Array{RGB{Float32},2} to Array{Float32,2}](https://discourse.julialang.org/t/convert-array-rgb-float32-2-to-array-float32-2/64312)

<div class="topic-metadata">

**Author:** [@KyleModell](https://discourse.julialang.org/u/KyleModell)\
**Replies:** 4\
**Last updated:** [July 9, 2021, 1:07am UTC](https://discourse.julialang.org/t/convert-array-rgb-float32-2-to-array-float32-2/64312 "2021-07-09T01:07:50Z")

</div>

I have an image that is Type: Array{RGB{Float32},2} but need to convert it to Type: Array{Float32,2}. Is there a way to do that ? Thanks!

[Previous page](https://discourse.julialang.org/latest.md?page=1334)

[Next page](https://discourse.julialang.org/latest.md?page=1336)
