{"id":16705092,"url":"https://github.com/mcabbott/arrayallez.jl","last_synced_at":"2026-01-02T14:03:18.323Z","repository":{"id":56698917,"uuid":"165070143","full_name":"mcabbott/ArrayAllez.jl","owner":"mcabbott","description":"🏎","archived":false,"fork":false,"pushed_at":"2021-04-10T15:15:55.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T19:28:29.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcabbott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-10T14:03:56.000Z","updated_at":"2021-04-10T14:24:06.000Z","dependencies_parsed_at":"2022-08-15T23:31:21.051Z","dependency_job_id":null,"html_url":"https://github.com/mcabbott/ArrayAllez.jl","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FArrayAllez.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FArrayAllez.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FArrayAllez.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcabbott%2FArrayAllez.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcabbott","download_url":"https://codeload.github.com/mcabbott/ArrayAllez.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243561233,"owners_count":20311061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T19:28:39.010Z","updated_at":"2026-01-02T14:03:13.291Z","avatar_url":"https://github.com/mcabbott.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArrayAllez.jl\n\n[![Travis CI](https://travis-ci.com/mcabbott/ArrayAllez.jl.svg?branch=master)](https://travis-ci.com/mcabbott/ArrayAllez.jl)\n[![Github CI](https://github.com/mcabbott/ArrayAllez.jl/workflows/CI/badge.svg)](https://github.com/mcabbott/ArrayAllez.jl/actions?query=workflow%3ACI+branch%3Amaster)\n\n```\n] add ArrayAllez\n```\n\n### `log! ∘ exp!`\n\nThis began as a way to more conveniently choose between [Yeppp!](https://github.com/JuliaMath/Yeppp.jl) \nand [AppleAccelerate](https://github.com/JuliaMath/AppleAccelerate.jl)\nand [IntelVectorMath](https://github.com/JuliaMath/IntelVectorMath.jl),\nwithout requiring that any by installed. \nThe fallback version is just a loop, with `@threads` for large enough arrays.\n\n```julia\nx = rand(1,100);\n\ny = exp0(x)  # precisely = exp.(x)\nx ≈ log!(y)  # in-place, just a loop\n\nusing AppleAccelerate  # or using IntelVectorMath, or using Yeppp\n\ny = exp!(x)  # with ! mutates\nx = log_(y)  # with _ copies\n```\n\nBesides `log!` and `exp!`, there is also `scale!` which understands rows/columns. \nAnd `iscale!` which divides, and `inv!` which is an element-wise inverse.\nAll have non-mutating versions ending `_` instead of `!`, and simple broadcast-ed versions with `0`.\n\n```julia\nm = ones(3,7)\nv = rand(3)\nr = rand(7)'\n\nscale0(m, 99)  # simply m .* 99\nscale_(m, v)   # like m .* v but using rmul!\niscale!(m, r)  # like m ./ r but mutating.\nm\n```\n\n### `∇`\n\nThese commands all make some attempt to define gradients for use with \n[Tracker](https://github.com/FluxML/Tracker.jl) ans \n[Zygote](https://github.com/FluxML/Zygote.jl), but caveat emptor. \nThere is also an `exp!!` which mutates both its forward input and its backward gradient, \nwhich may be a terrible idea.\n\n```julia\nusing Tracker\nx = param(randn(5));\ny = exp_(x)\n\nTracker.back!(sum_(exp!(x)))\nx.data == y # true\nx.grad\n```\n\nThis package also defines gradients for `prod` (overwriting an incorrect one) and `cumprod`, \nas in [this PR](https://github.com/FluxML/Flux.jl/pull/524). \n\n### `Array_`\n\nAn experiment with [LRUCache](https://github.com/JuliaCollections/LRUCache.jl) for working space:\n\n```julia\nx = rand(2000)' # turns off below this size\n\ncopy_(:copy, x)\nsimilar_(:sim, x)\nArray_{Float64}(:new, 5,1000) # @btime 200 ns, 32 bytes\n\ninv_(:inv, x) # most of the _ functions can opt-in\n```\n\n### `@dropdims`\n\nThis macro wraps reductions like `sum(A; dims=...)` in `dropdims()`.\nIt understands things like this:\n\n```julia\n@dropdims sum(10 .* randn(2,10); dims=2) do x\n    trunc(Int, x)\nend\n```\n\n### Removed\n\nThis package used to provide two functions generalising matrix multiplication. They are now better handled by other packages:\n\n* `TensorCore.boxdot` contracts neighbours: `rand(2,3,5) ⊡ rand(5,7,11) |\u003e size == (2,3,7,11)`\n* `NNlib.batched_mul` keeps a batch dimension: `rand(2,3,10) ⊠ rand(3,5,10) |\u003e size == (2,5,10)`\n\n### See Also\n\n* [Vectorize.jl](https://github.com/rprechelt/Vectorize.jl) is a more comprehensive wrapper. \n\n* [Strided.jl](https://github.com/Jutho/Strided.jl) adds `@threads` to broadcasting. \n\n* [LoopVectorization.jl](https://github.com/chriselrod/LoopVectorization.jl) adds AVX black magic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcabbott%2Farrayallez.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcabbott%2Farrayallez.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcabbott%2Farrayallez.jl/lists"}