You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/func.jl
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,7 @@ function `adjoint_inverse`. All are assumed to have the same calling signature a
120
120
below traits.
121
121
122
122
## Traits
123
+
123
124
Keyword arguments are used to set operator traits, which are assumed to be
124
125
uniform across `op`, `op_adjoint`, `op_inverse`, `op_adjoint_inverse`.
125
126
@@ -132,6 +133,7 @@ uniform across `op`, `op_adjoint`, `op_inverse`, `op_adjoint_inverse`.
132
133
* `has_mul5` - `true` if the operator provides a five-argument `mul!` via the signature `op(v, u, p, t, α, β; <accepted_kwargs>)`. This trait is inferred if no value is provided.
133
134
* `isconstant` - `true` if the operator is constant, and doesn't need to be updated via `update_coefficients[!]` during operator evaluation.
134
135
* `islinear` - `true` if the operator is linear. Defaults to `false`.
136
+
* `batch` - Boolean indicating if the input/output arrays comprise of batched vectors. If `true`, the last dimension of input/output arrays is considered to be the batch dimension and is not involved in size computation. For example, let `size(output), size(input) = (M, K), (N, K)`. If `batch = true`, then the second dimension is assumed to be the batch dimension, and the `size(F::FunctionOperator) = (M, N)`. If `batch = false`, then `size(F::FunctionOperator) = (M * K, M * K)`.
135
137
* `ifcache` - Allocate cache arrays in constructor. Defaults to `true`. Cache can be generated afterwards by calling `cache_operator(L, input, output)`
136
138
* `cache` - Pregenerated cache arrays for in-place evaluations. Expected to be of type and shape `(similar(input), similar(output),)`. The constructor generates cache if no values are provided. Cache generation by the constructor can be disabled by setting the kwarg `ifcache = false`.
137
139
* `opnorm` - The norm of `op`. Can be a `Number`, or function `opnorm(p::Integer)`. Defaults to `nothing`.
@@ -159,6 +161,7 @@ function FunctionOperator(op,
159
161
isconstant::Bool=false,
160
162
islinear::Bool=false,
161
163
164
+
batch::Bool=false,
162
165
ifcache::Bool=true,
163
166
cache::Union{Nothing, NTuple{2}}=nothing,
164
167
@@ -171,10 +174,22 @@ function FunctionOperator(op,
171
174
172
175
# store eltype of input/output for caching with ComposedOperator.
0 commit comments