# Latest

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

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

**Page:** 1242

---

## [(Flux) Moving data between cpu and gpu: "This intrinsic must be compiled to be called"](https://discourse.julialang.org/t/flux-moving-data-between-cpu-and-gpu-this-intrinsic-must-be-compiled-to-be-called/69595)

<div class="topic-metadata">

**Author:** [@c-state](https://discourse.julialang.org/u/c-state)\
**Replies:** 1\
**Last updated:** [October 12, 2021, 2:08am UTC](https://discourse.julialang.org/t/flux-moving-data-between-cpu-and-gpu-this-intrinsic-must-be-compiled-to-be-called/69595 "2021-10-12T02:08:35Z")

</div>

The title and example really say it all. I’m using Flux.jl version 0.12.7 and CUDA.jl 3.5.0. MWE: julia\> using Flux julia\> x = \[1, 2\] 2-element Vector{Int64}: 1 2 julia\> Flux.pullback(() -\> gpu(x)) ERROR: this intr…

---

## [ODE and Turing problems with sparse and transformed data](https://discourse.julialang.org/t/ode-and-turing-problems-with-sparse-and-transformed-data/68895)

<div class="topic-metadata">

**Author:** [@99dB](https://discourse.julialang.org/u/99dB)\
**Replies:** 7\
**Last updated:** [October 12, 2021, 1:42am UTC](https://discourse.julialang.org/t/ode-and-turing-problems-with-sparse-and-transformed-data/68895 "2021-10-12T01:42:03Z")

</div>

Dear Julia community, I am new to julia and try to implement a complex bayesian inference procedure on a ODE system, using turing. I base my code on the great turing tutorial: Bayesian Estimation of Differential Equati…

---

## [Addprocs error](https://discourse.julialang.org/t/addprocs-error/69458)

<div class="topic-metadata">

**Author:** [@pmarg](https://discourse.julialang.org/u/pmarg)\
**Replies:** 3\
**Last updated:** [October 12, 2021, 1:23am UTC](https://discourse.julialang.org/t/addprocs-error/69458 "2021-10-12T01:23:06Z")

</div>

I just installed Julia on a new PC and cannot add more than 7 workers. The PC has 32 cores and if use addprocs(32) Julia crashes. julia\> addprocs(1) 1-element Vector{Int64}: 2 julia\> addprocs(1) 1-element Vector{Int64…

---

## [@threads uses only half the number of nthreads()](https://discourse.julialang.org/t/threads-uses-only-half-the-number-of-nthreads/54058)

<div class="topic-metadata">

**Author:** [@msekino](https://discourse.julialang.org/u/msekino)\
**Replies:** 10\
**Last updated:** [October 12, 2021, 12:58am UTC](https://discourse.julialang.org/t/threads-uses-only-half-the-number-of-nthreads/54058 "2021-10-12T00:58:07Z")

</div>

Recently I built a PC with Ryzen Threadripper 3990X, which has 64 cores and 128 threads. The OS is Windows 10 Pro. When I tried the code below, only 64 threads reached 100% as shown in the attached image. Why aren’t a…

---

## [Birthday in Pi](https://discourse.julialang.org/t/birthday-in-pi/69590)

<div class="topic-metadata">

**Author:** [@Jesus-117](https://discourse.julialang.org/u/Jesus-117)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 11:54pm UTC](https://discourse.julialang.org/t/birthday-in-pi/69590 "2021-10-11T23:54:11Z")

</div>

Hi! , recently I have been curious about how to do exercises from MatLab to Julia and I started doing the birthday day in pi, in MatLab there is the function “SequencePosition” that helps in this type of problems. My que…

---

## [Qs about trained model: (1) testmode! vs excluding Dropout layers; (2) size of BSON file](https://discourse.julialang.org/t/qs-about-trained-model-1-testmode-vs-excluding-dropout-layers-2-size-of-bson-file/69572)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 3\
**Last updated:** [October 11, 2021, 11:44pm UTC](https://discourse.julialang.org/t/qs-about-trained-model-1-testmode-vs-excluding-dropout-layers-2-size-of-bson-file/69572 "2021-10-11T23:44:07Z")

</div>

(1) I trained the NN model and want to use it further, i.e, load from the disk. What is the best way to predict: (i) with Flux.testmode! and Dropout layers; (ii) without Dropout layers and without Flux.testmode!? (2) My…

---

## [Is there a way to serialize a CURAND RNG?](https://discourse.julialang.org/t/is-there-a-way-to-serialize-a-curand-rng/34493)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [October 11, 2021, 9:15pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-serialize-a-curand-rng/34493 "2021-10-11T21:15:16Z")

</div>

With Base, I can take the RNG returned by Random.default\_rng(), write it to file with eg JLD2, then later reload it and reproduce my random number sequence from that point. Is something like this possible with CURAND? I…

---

## [Get value of column corresponding to condition being met for another column in a Grouped DataFrame](https://discourse.julialang.org/t/get-value-of-column-corresponding-to-condition-being-met-for-another-column-in-a-grouped-dataframe/69586)

<div class="topic-metadata">

**Author:** [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 8:37pm UTC](https://discourse.julialang.org/t/get-value-of-column-corresponding-to-condition-being-met-for-another-column-in-a-grouped-dataframe/69586 "2021-10-11T20:37:09Z")

</div>

using DataFrames, DataFramesMeta df = DataFrame(x = \[1,1,1,2,2,2\], y = \[1,2,3,101,102,103\], z = \[5, 6, 7, 505, 506, 507\]) gdf = groupby(df, :x) @combine(gdf, :MaxY = maximum(:y)) Above is MWE. I group by x column and f…

---

## [BinaryBuilder: generating \`\*\_jll.jl\` package without recompiling the binary](https://discourse.julialang.org/t/binarybuilder-generating-jll-jl-package-without-recompiling-the-binary/68966)

<div class="topic-metadata">

**Author:** [@circonflexe](https://discourse.julialang.org/u/circonflexe)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 8:04pm UTC](https://discourse.julialang.org/t/binarybuilder-generating-jll-jl-package-without-recompiling-the-binary/68966 "2021-10-11T20:04:41Z")

</div>

So I am compiling a huge library inside BinaryBuilder. After some tweaking, the compilation went right. Now I want to generate the .jl package (for local use). I know that julia build\_tarballs.jl --deploy-jll=local will …

---

## [A Question about struct](https://discourse.julialang.org/t/a-question-about-struct/69582)

<div class="topic-metadata">

**Author:** [@IsraelSI](https://discourse.julialang.org/u/IsraelSI)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 7:31pm UTC](https://discourse.julialang.org/t/a-question-about-struct/69582 "2021-10-11T19:31:50Z")

</div>

Sorry, I’m new to Julia and I have a little conflict with the structures, for example if I have 2 structures corresponding to a polygon and a segment. tstruct segment first\_vertex::Array second\_vertex::Array …

---

## [Why NTuple{2, Ref{Int}} \<: NTuple get false?](https://discourse.julialang.org/t/why-ntuple-2-ref-int-ntuple-get-false/69559)

<div class="topic-metadata">

**Author:** [@zwtechnb](https://discourse.julialang.org/u/zwtechnb)\
**Replies:** 7\
**Last updated:** [October 11, 2021, 7:23pm UTC](https://discourse.julialang.org/t/why-ntuple-2-ref-int-ntuple-get-false/69559 "2021-10-11T19:23:07Z")

</div>

Code: julia\> NTuple{2, Int} \<: NTuple true julia\> NTuple{2, Ref{Int}} \<: NTuple false julia\> (NTuple{2, T} where T) \<: NTuple true

---

## [CellListMap.jl / CellListMap.florpi documentation](https://discourse.julialang.org/t/celllistmap-jl-celllistmap-florpi-documentation/68390)

<div class="topic-metadata">

**Author:** [@anon28281882](https://discourse.julialang.org/u/anon28281882)\
**Replies:** 2\
**Last updated:** [October 11, 2021, 7:21pm UTC](https://discourse.julialang.org/t/celllistmap-jl-celllistmap-florpi-documentation/68390 "2021-10-11T19:21:28Z")

</div>

Is there any documentation on CellListMap.florpi “function” / “code” that computes pairwise velocity distributions? Any additional information like github documentation, research paper, accessible explanation in literatu…

---

## [How to define a numerical value in Julia?](https://discourse.julialang.org/t/how-to-define-a-numerical-value-in-julia/69574)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [October 11, 2021, 6:47pm UTC](https://discourse.julialang.org/t/how-to-define-a-numerical-value-in-julia/69574 "2021-10-11T18:47:46Z")

</div>

I keep getting the below error: LoadError: UndefVarError: n1 not defined for my below code: n1 = 0; for i in 1:m\[1\], j in 1:m\[2\] n1 += 1; A\[n1,:\] = \[X0\[i,j\] Y0\[i,j\] E0\[i,j\]\]; end Hasn’t my “n1=0;” def…

---

## [Making a fast evaluation of a function and its gradient](https://discourse.julialang.org/t/making-a-fast-evaluation-of-a-function-and-its-gradient/68884)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 32\
**Last updated:** [October 11, 2021, 5:32pm UTC](https://discourse.julialang.org/t/making-a-fast-evaluation-of-a-function-and-its-gradient/68884 "2021-10-11T17:32:33Z")

</div>

Hi everybody, I have written a script that evaluates a non-linear function feta over a 2D domain. The function returns eta that depends on other 2D fields (Exx, Eyy, Exy). I try to compute the gradient of eta w.r.t Exx…

---

## [Zygote: how to get intermediate values without evaluating function twice?](https://discourse.julialang.org/t/zygote-how-to-get-intermediate-values-without-evaluating-function-twice/69126)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 4\
**Last updated:** [October 11, 2021, 5:17pm UTC](https://discourse.julialang.org/t/zygote-how-to-get-intermediate-values-without-evaluating-function-twice/69126 "2021-10-11T17:17:17Z")

</div>

Perhaps my issue is best illustrated with a toy example. I have a function loss(x, y, z). This function returns a scalar value MSE; however, it also calculates some intermediate values during the computation, which I als…

---

## [Why can't I see execution results to the right of the executed code?](https://discourse.julialang.org/t/why-cant-i-see-execution-results-to-the-right-of-the-executed-code/69567)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [October 11, 2021, 4:55pm UTC](https://discourse.julialang.org/t/why-cant-i-see-execution-results-to-the-right-of-the-executed-code/69567 "2021-10-11T16:55:02Z")

</div>

In VSCode I went through the following menu options: File -\> Preferences -\> Settings -\> Extensions -\> Julia -\> Execution: Result Type Within this item I chose both from the dropdown list. I did this for both the User …

---

## [Transparent series points on a plot](https://discourse.julialang.org/t/transparent-series-points-on-a-plot/69569)

<div class="topic-metadata">

**Author:** [@pthompson234](https://discourse.julialang.org/u/pthompson234)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 4:43pm UTC](https://discourse.julialang.org/t/transparent-series-points-on-a-plot/69569 "2021-10-11T16:43:18Z")

</div>

Hi, this may be a simple question, but I would like to make a scatter plot where all markers have the same color, but some are more transparent than others. To do this, I have constructed a vector of RGBA objects, like b…

---

## [What is the meaning of: while false end](https://discourse.julialang.org/t/what-is-the-meaning-of-while-false-end/69507)

<div class="topic-metadata">

**Author:** [@eliascarv](https://discourse.julialang.org/u/eliascarv)\
**Replies:** 7\
**Last updated:** [October 11, 2021, 3:05pm UTC](https://discourse.julialang.org/t/what-is-the-meaning-of-while-false-end/69507 "2021-10-11T15:05:39Z")

</div>

I’ve seen this line of code used in some packages and Julia source code: while false end I assume it’s used for precompilation, but I’m not sure. Could someone explain what the purpose of this line of code is?

---

## [Distributing a function that uses FFTW](https://discourse.julialang.org/t/distributing-a-function-that-uses-fftw/69564)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [October 11, 2021, 2:57pm UTC](https://discourse.julialang.org/t/distributing-a-function-that-uses-fftw/69564 "2021-10-11T14:57:30Z")

</div>

Hi! I’ve been having a lot of trouble using pmap with a function that uses FFTW with a planned FFT. Here is a minimum example, where I just try to perform a FFT on an array of matrices: @everywhere using FFTW using Dist…

---

## [Julia notebooks takes too long connect to the kernel while using Jupyter](https://discourse.julialang.org/t/julia-notebooks-takes-too-long-connect-to-the-kernel-while-using-jupyter/69509)

<div class="topic-metadata">

**Author:** [@Vaibhavi\_Bhalchandra](https://discourse.julialang.org/u/Vaibhavi_Bhalchandra)\
**Replies:** 6\
**Last updated:** [October 11, 2021, 2:54pm UTC](https://discourse.julialang.org/t/julia-notebooks-takes-too-long-connect-to-the-kernel-while-using-jupyter/69509 "2021-10-11T14:54:53Z")

</div>

I am using ubuntu, and installed julia version 1.0.4 using “sudo snap install julia --classic”. Whenever I try to use julia in jupyter- it tasks solid 10-15 minutes to connect to the kernel and start running. could this …

---

## [How to suppress specific warning?](https://discourse.julialang.org/t/how-to-suppress-specific-warning/69502)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 6\
**Last updated:** [October 11, 2021, 1:55pm UTC](https://discourse.julialang.org/t/how-to-suppress-specific-warning/69502 "2021-10-11T13:55:43Z")

</div>

I get the following warning when plotting two surfaces with different colors but only showing one colorbar, which is what I want: ┌ Warning: Multiple series with different fill alpha share a colorbar. Colorbar may not r…

---

## [Performance difference in permuting Arrays](https://discourse.julialang.org/t/performance-difference-in-permuting-arrays/69425)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 4\
**Last updated:** [October 11, 2021, 1:23pm UTC](https://discourse.julialang.org/t/performance-difference-in-permuting-arrays/69425 "2021-10-11T13:23:04Z")

</div>

Hi guys, I am trying to permute/shuffle a Vector of Vectors given a certain index. Some vectors can occur several times, so I need a buffer container for no allocations. MWE: vals = \[ \[1, 2, 3\], \[4, 5, 6\], \[7, 8, 9\] \] …

---

## [Trying to Use PackageCompiler.jl](https://discourse.julialang.org/t/trying-to-use-packagecompiler-jl/69275)

<div class="topic-metadata">

**Author:** [@chelseas](https://discourse.julialang.org/u/chelseas)\
**Replies:** 8\
**Last updated:** [October 11, 2021, 11:59am UTC](https://discourse.julialang.org/t/trying-to-use-packagecompiler-jl/69275 "2021-10-11T11:59:42Z")

</div>

I’m trying to use packagecompiler.jl and I don’t know what I’m doing wrong: (NNFuelGage.jl) pkg\> julia\> using Interpolations julia\> using JuMP julia\> using LazySets usin julia\> using MathOptInterface julia\> using G…

---

## [Surprising evaluation order](https://discourse.julialang.org/t/surprising-evaluation-order/69555)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 4\
**Last updated:** [October 11, 2021, 11:27am UTC](https://discourse.julialang.org/t/surprising-evaluation-order/69555 "2021-10-11T11:27:18Z")

</div>

The following program mutable struct Node{T} value::T left::Union{Nothing, Node{T}} right::Union{Nothing, Node{T}} end const Tree{T} = Union{Nothing, Node{T}} function rotateright1(tree::Node{T}) where T …

---

## [Spherical version of \`volume\`](https://discourse.julialang.org/t/spherical-version-of-volume/69557)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 0\
**Last updated:** [October 11, 2021, 11:25am UTC](https://discourse.julialang.org/t/spherical-version-of-volume/69557 "2021-10-11T11:25:05Z")

</div>

In Makie.jl the volume function can be used to visualize a 3D scalar field defined on a square lattice. If I have a scalar field in spherical coordinates, what can be used to visualize it?

---

## [How to calculate bounding box of a text primitive BEFORE Luxor.Drawing()](https://discourse.julialang.org/t/how-to-calculate-bounding-box-of-a-text-primitive-before-luxor-drawing/69556)

<div class="topic-metadata">

**Author:** [@jg-854](https://discourse.julialang.org/u/jg-854)\
**Replies:** 2\
**Last updated:** [October 11, 2021, 10:58am UTC](https://discourse.julialang.org/t/how-to-calculate-bounding-box-of-a-text-primitive-before-luxor-drawing/69556 "2021-10-11T10:58:16Z")

</div>

I want to determine the appropriate size of a drawing before calling Luxor.Drawing()… This results in needing to calculate the bounding box of all components within my drawing. Luxor provides the convenient method Boundi…

---

## [Finding the value of a field at a spatial location in JuAFEM](https://discourse.julialang.org/t/finding-the-value-of-a-field-at-a-spatial-location-in-juafem/38975)

<div class="topic-metadata">

**Author:** [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Replies:** 7\
**Last updated:** [October 11, 2021, 9:48am UTC](https://discourse.julialang.org/t/finding-the-value-of-a-field-at-a-spatial-location-in-juafem/38975 "2021-10-11T09:48:12Z")

</div>

Is there a relatively simple way to extract the value of a field in JuAFEM at a point in space within the grid? Use cases are - visualisation within Julia (not using ParaView); doing inverse problems with point observati…

---

## [DifferentialEquations.jl - how to calculate an 'assignment' and pass back to an ODE?](https://discourse.julialang.org/t/differentialequations-jl-how-to-calculate-an-assignment-and-pass-back-to-an-ode/69390)

<div class="topic-metadata">

**Author:** [@bgsmall](https://discourse.julialang.org/u/bgsmall)\
**Replies:** 10\
**Last updated:** [October 11, 2021, 9:29am UTC](https://discourse.julialang.org/t/differentialequations-jl-how-to-calculate-an-assignment-and-pass-back-to-an-ode/69390 "2021-10-11T09:29:22Z")

</div>

Hi. I have hit a snag in that I wish to calculate a quantity u\[3\] as an ‘assignment’ (not sure that is the correct terminology) within the ODE function and pass back to one of my ODE’s du\[3\] My code is below: # Package…

---

## [GraphRecipes graphplot discrepancy nodeshape and nodecolor](https://discourse.julialang.org/t/graphrecipes-graphplot-discrepancy-nodeshape-and-nodecolor/69549)

<div class="topic-metadata">

**Author:** [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Replies:** 0\
**Last updated:** [October 11, 2021, 9:09am UTC](https://discourse.julialang.org/t/graphrecipes-graphplot-discrepancy-nodeshape-and-nodecolor/69549 "2021-10-11T09:09:07Z")

</div>

The following MWE gives incorrect colours for specified node shapes: using GraphRecipes using Plots M = \[0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 …

---

## [Workspace and plot windows](https://discourse.julialang.org/t/workspace-and-plot-windows/69438)

<div class="topic-metadata">

**Author:** [@Piotr](https://discourse.julialang.org/u/Piotr)\
**Replies:** 4\
**Last updated:** [October 11, 2021, 8:57am UTC](https://discourse.julialang.org/t/workspace-and-plot-windows/69438 "2021-10-11T08:57:36Z")

</div>

Is there a possibility to open Julia workspace and/or plots in a separate window in Juno (Atom)? I am used to this in MATLAB and Stata, but I can’t find this option in Juno (Atom). This feature is really useful when wor…

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

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