Content-Length: 202219 | pFad | http://github.com/bsc-quantic/Tenet.jl/issues/293

D1 `getindex(::Tensor; kwargs...)` returns an `AbstractArray` when it should return a `Tensor` · Issue #293 · bsc-quantic/Tenet.jl · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getindex(::Tensor; kwargs...) returns an AbstractArray when it should return a Tensor #293

Open
mofeing opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mofeing
Copy link
Member

mofeing commented Jan 17, 2025

julia> T = Tensor(rand(2, 2, 2, 2), (:i, :j, :k, :l))
2×2×2×2 Tensor{Float64, 4, Array{Float64, 4}}:
[:, :, 1, 1] =
 0.203794  0.890273
 0.637581  0.756578

[:, :, 2, 1] =
 0.649558  0.408352
 0.23286   0.51925

[:, :, 1, 2] =
 0.297936  0.153945
 0.546996  0.484567

[:, :, 2, 2] =
 0.561427  0.422659
 0.968955  0.703751

julia> T[i = 1]
2×2×2 Array{Float64, 3}:
[:, :, 1] =
 0.203794  0.649558
 0.890273  0.408352

[:, :, 2] =
 0.297936  0.561427
 0.153945  0.422659
@mofeing mofeing added the bug Something isn't working label Jan 17, 2025
@mofeing
Copy link
Member Author

mofeing commented Jan 17, 2025

in order to avoid type-instability problems, we probably need a case checking on comptime when all indices are set (well, the same number of indices), then return a scalar and not a 0-dim Tensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/bsc-quantic/Tenet.jl/issues/293

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy