Skip to content

Commit 6b668fc

Browse files
committed
Correct some typos
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
1 parent 9fda424 commit 6b668fc

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

src/rulesets/Base/array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ materialises each zero `ẋ` to be `zero(x)`.
7272
_instantiate_zeros(ẋs, xs) = map(_i_zero, ẋs, xs)
7373
_i_zero(ẋ, x) =
7474
_i_zero(ẋ::AbstractZero, x) = zero(x)
75-
# Possibly this won't work for partly non-diff arrays, sometihng like `gradient(x -> ["abc", x][end], 1)`
75+
# Possibly this won't work for partly non-diff arrays, something like `gradient(x -> ["abc", x][end], 1)`
7676
# may give a MethodError for `zero` but won't be wrong.
7777

7878
# Fast paths. Should it also collapse all-Zero cases?

src/rulesets/Base/base.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ end
175175

176176
ChainRulesCore.derivatives_given_output(Ω, ::typeof(identity), x) = tuple(tuple(true))
177177

178-
# rouding related,
178+
# rounding related,
179179
# we use `zero` rather than `ZeroTangent()` for scalar, and avoids issues with map etc
180180
@scalar_rule round(x) zero(x)
181181
@scalar_rule floor(x) zero(x)

src/rulesets/Base/fastmath_able.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let
22
# Include inside this quote any rules that should have FastMath versions
33
# IMPORTANT:
4-
# Do not add any rules here for functions that do not have varients in Base.FastMath
4+
# Do not add any rules here for functions that do not have variants in Base.FastMath
55
# e.g. do not add `foo` unless `Base.FastMath.foo_fast` exists.
66
fastable_ast = quote
77
# Trig-Basics

src/rulesets/Base/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function frule((_, ẋ), ::typeof(getindex), x::Tuple, i)
1111
return y, Tangent{typeof(y)}(ẋ[i]...)
1212
end
1313

14-
"for a given typle type, returns a Val{N} where N is the length of the tuple"
14+
"for a given tuple type, returns a Val{N} where N is the length of the tuple"
1515
_tuple_N(::Type{<:Tuple{Vararg{Any, N}}}) where {N} = Val(N)
1616

1717
function rrule(::typeof(getindex), x::T, i::Integer) where {T<:Tuple}

src/rulesets/Base/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ end
194194

195195
# Fix dispatch for this pidgeon-hole optimization,
196196
# Rules with RuleConfig dispatch with priority over without (regardless of other args).
197-
# and if we don't specify what do do for one that HasReverseMode then it is ambigious
197+
# and if we don't specify what do do for one that HasReverseMode then it is ambiguous
198198
for Config in (RuleConfig, RuleConfig{>:HasReverseMode})
199199
@eval function rrule(
200200
::$Config, ::typeof(sum), ::typeof(abs2), x::AbstractArray{T}; dims=:,

src/rulesets/LinearAlgebra/dense.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ end
120120

121121
function frule((_, Δx), ::typeof(det), x::AbstractMatrix)
122122
Ω = det(x)
123-
# TODO Performance optimization: probably there is an efficent
123+
# TODO Performance optimization: probably there is an efficient
124124
# way to compute this trace without during the full compution within
125125
return Ω, Ω * tr(x \ Δx)
126126
end

test/rulesets/Base/fastmath_able.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Add tests to the quote for functions with FastMath varients.
1+
# Add tests to the quote for functions with FastMath variants.
22
function jacobian_via_frule(f,z)
33
du_dx, dv_dx = reim(frule((ZeroTangent(), 1),f,z)[2])
44
du_dy, dv_dy = reim(frule((ZeroTangent(),im),f,z)[2])
@@ -38,7 +38,7 @@ function complex_jacobian_test(f, z)
3838
end
3939

4040
# IMPORTANT:
41-
# Do not add any tests here for functions that do not have varients in Base.FastMath
41+
# Do not add any tests here for functions that do not have variants in Base.FastMath
4242
# e.g. do not add `foo` unless `Base.FastMath.foo_fast` exists.
4343
const FASTABLE_AST = quote
4444
@testset "Trig" begin

test/rulesets/Base/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
test_rrule(getindex, x, CartesianIndex(2, 3))
4141
end
4242

43-
@testset "slice/index postions" begin
43+
@testset "slice/index positions" begin
4444
test_rrule(getindex, x, 2:3)
4545
test_rrule(getindex, x, 3:-1:2)
4646
test_rrule(getindex, x, [3,2])

test/rulesets/LinearAlgebra/factorization.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ end
510510
@testset "$op" for op in (det, logdet)
511511
@testset "$T" for T in (Float64, ComplexF64)
512512
n = 5
513-
# rand (not randn) so det will be postive, so logdet will be defined
513+
# rand (not randn) so det will be positive, so logdet will be defined
514514
A = 3 * rand(T, (n, n))
515515
X = Cholesky(A * A' + I, p, 0)
516516
X̄_acc = Tangent{typeof(X)}(; factors=Diagonal(randn(T, n))) # sensitivity is always a diagonal
@@ -547,7 +547,7 @@ end
547547
C = cholesky(A)
548548
B = randn(T, sz)
549549
# because the rule calls the rrule for getproperty, its rrule is not
550-
# completely type-inferrable
550+
# completely type-inferable
551551
test_rrule(\, C, B; check_inferred=false)
552552
end
553553
end
@@ -559,7 +559,7 @@ end
559559
C = cholesky(A)
560560
B = randn(T, 5, n)
561561
# because the rule calls the rrule for getproperty, its rrule is not
562-
# completely type-inferrable
562+
# completely type-inferable
563563
test_rrule(/, B, C; check_inferred=false)
564564
end
565565
end

test/rulesets/LinearAlgebra/matfun.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
A = randn(T, n, n)
4949
A *= nrm / opnorm(A, 1)
50-
# rrule is not inferrable, but pullback should be
50+
# rrule is not inferable, but pullback should be
5151
tols = nrm == 0.1 ? (atol=1e-8, rtol=1e-8) : NamedTuple()
5252
test_rrule(exp, A; check_inferred=false, tols...)
5353
Y, back = rrule(exp, A)

0 commit comments

Comments
 (0)