Skip to content

A(θ)' * y for ParMatrix errors #6

@ziyiyin97

Description

@ziyiyin97
using ParametricOperators

A = ParMatrix(Float32, 4, 5)
θ = init(A)
x = randn(Float32, 5)
y = randn(Float32, 4)
output1 = A(θ) * x      # this works
output2 = A(θ)' * y     # this doesn't

Error log:

ERROR: LoadError: ArgumentError: invalid index: ParMatrix{Float32}(4, 5, UUID("93f79dbc-05db-4fb1-9d23-6248e5dfcf25")) of type ParMatrix{Float32}
Stacktrace:
  [1] to_index(i::ParMatrix{Float32})
    @ Base ./indices.jl:300
  [2] to_index(A::Matrix{Float32}, i::ParMatrix{Float32})
    @ Base ./indices.jl:277
  [3] to_indices
    @ ./indices.jl:333 [inlined]
  [4] to_indices
    @ ./indices.jl:325 [inlined]
  [5] getindex
    @ ./abstractarray.jl:1241 [inlined]
  [6] (::ParParameterized{Float32, Float32, ParametricOperators.Linear, ParAdjoint{Float32, Float32, ParametricOperators.Parametric, ParMatrix{Float32}}, Matrix{Float32}})(x::Vector{Float32})
    @ ParametricOperators ~/.julia/dev/ParametricOperators/src/ParMatrix.jl:31
  [7] *(A::ParParameterized{Float32, Float32, ParametricOperators.Linear, ParAdjoint{Float32, Float32, ParametricOperators.Parametric, ParMatrix{Float32}}, Matrix{Float32}}, x::Vector{Float32})
    @ ParametricOperators ~/.julia/dev/ParametricOperators/src/ParOperator.jl:221
  [8] top-level scope
    @ ~/.julia/dev/ParametricOperators/test/MFE.jl:8
  [9] include(fname::String)
    @ Base.MainInclude ./client.jl:476
 [10] top-level scope
    @ REPL[1]:1
in expression starting at /Users/ziyiyin/.julia/dev/ParametricOperators/test/MFE.jl:8

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions