mcabbott / mcabbott/TensorCast.jl

@cast works for hcat but not for [ ]

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

Nobody has claimed this yet.

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

Description

This works,

@cast P[i,j,k] := hcat(R[:,:,k],X₁[:,k])[i,j]

but this does not

@cast P[i,j,k] := [R[:,:,k] X₁[:,k]][i,j]

It gives the error,

DimensionMismatch: stack expects uniform slices, got axes(x) == (1:3,) while first had (1:3, 1:4)

Should it? Thanks!

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

Reproduce the two examples in Julia, starting at the @cast entry point and comparing hcat with bracket concatenation. No source file or test is named in the issue; done means determining whether [R[:,:,k] X₁[:,k]][i,j] should work and covering the chosen behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.