Skip to content

Commit fd82236

Browse files
enzyme-ci-bot[bot]wsmoses
authored andcommitted
Format Julia code
1 parent a540507 commit fd82236

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

ext/ReactantStructArraysExt.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function __init__()
3131
Reactant.@skip_rewrite_func StructArrays.index_type
3232
end
3333

34-
3534
StructArrays.always_struct_broadcast(::AbstractReactantArrayStyle) = true
3635

3736
function Base.copy(

src/TracedRArray.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ Base.collect(x::TracedRArray) = copy(x)
6666
Base.copy(A::TracedRArray{T,N}) where {T,N} = TracedRArray{T,N}((), A.mlir_data, size(A))
6767

6868
function Base.similar(::TracedRArray, ::Type{T}, dims::Dims{N}) where {T,N}
69-
return (@opcall fill(zero(unwrapped_eltype(T)), dims))::TracedRArray{unwrapped_eltype(T), N}
69+
return (@opcall fill(
70+
zero(unwrapped_eltype(T)), dims
71+
))::TracedRArray{unwrapped_eltype(T),N}
7072
end
7173

7274
function Base.similar(::Type{<:TracedRArray{T}}, dims::Dims{N}) where {T,N}
73-
return (@opcall fill(zero(T), dims))::TracedRArray{T, N}
75+
return (@opcall fill(zero(T), dims))::TracedRArray{T,N}
7476
end
7577

7678
function Base.show(io::IOty, X::AnyTracedRArray) where {IOty<:Union{IO,IOContext}}
@@ -261,14 +263,14 @@ function Base.similar(
261263
::Broadcasted{AbstractReactantArrayStyle{N}}, ::Type{T}, dims
262264
) where {T<:Reactant.ReactantPrimitive,N}
263265
@assert N isa Int
264-
return (@opcall fill(zero(unwrapped_eltype(T)), dims))::TracedRArray{T, N}
266+
return (@opcall fill(zero(unwrapped_eltype(T)), dims))::TracedRArray{T,N}
265267
end
266268

267269
function Base.similar(
268270
::Broadcasted{AbstractReactantArrayStyle{N}}, ::Type{TracedRNumber{T}}, dims
269271
) where {T<:Reactant.ReactantPrimitive,N}
270272
@assert N isa Int
271-
return (@opcall fill(zero(T), dims))::TracedRArray{T, N}
273+
return (@opcall fill(zero(T), dims))::TracedRArray{T,N}
272274
end
273275

274276
function Base.copy(bc::Broadcasted{<:AbstractReactantArrayStyle{0}})

src/Types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ mutable struct TracedRArray{T,N} <: RArray{TracedRNumber{T},N}
7878
end
7979
return new{T,N}(paths, mlir_data, shape)
8080
end
81-
81+
8282
function TracedRArray{T,N}(::UndefInitializer, shape::Integer...) where {T,N}
83-
return similar(TracedRArray{T, N}, shape...)
83+
return similar(TracedRArray{T,N}, shape...)
8484
end
8585
end
8686

0 commit comments

Comments
 (0)