mcabbott / mcabbott/TensorCast.jl

array arguments in @cast indexing

Open
#70 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
142
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Here is a short example (Julia 1.9.2)

bsz = (8, 8);

#this doesnt work:
@cast b[(b1,b2), t, h,w] := img[(b1, h), (b2, w), t] (b1 in 1:bsz[1], b2 in 1:bsz[2]);

#this works:
bsz1 = bsz[1];
bsz2 = bsz[2];
@cast b[(b1,b2), t, h,w] := img[(b1, h), (b2, w), t] (b1 in 1:bsz1, b2 in 1:bsz2);

Is it expected behavior? Just learning Julia, couldn't find why this doesn't work in docs or other issues.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Julia 1.9.2 example and comparing the two @cast forms. Then inspect the @cast indexing behavior for tuple or array arguments; done means establishing whether this is expected and, if not, identifying the relevant fix or documentation needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.