From ad7d4e8bbb03a1b87ae70744f20874b88f47a2e8 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Tue, 6 Feb 2024 14:08:10 -0600 Subject: [PATCH 1/2] ci: fix doc deploy --- .github/workflows/Documenter.yml | 35 ++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index b91b123..b2ad773 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -5,14 +5,41 @@ on: tags: [v*] pull_request: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: - Documenter: + docs: name: Documentation runs-on: ubuntu-latest + permissions: + # needed to allow julia-actions/cache to proactively delete old caches that it has created + actions: write + contents: write + statuses: write steps: - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-docdeploy@latest + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - uses: julia-actions/cache@v1 + - name: Configure doc environment + shell: julia --project=docs --color=yes {0} + run: | + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + - name: Run doctests + shell: julia --project=docs --color=yes {0} + run: | + using Documenter: DocMeta, doctest + using TensorCore + DocMeta.setdocmeta!(TensorCore, :DocTestSetup, :(using TensorCore); recursive=true) + doctest(TensorCore) From c69e57723d0cc9401c3e377ca9a09e937dd508e8 Mon Sep 17 00:00:00 2001 From: Chengyu HAN Date: Tue, 6 Feb 2024 14:27:44 -0600 Subject: [PATCH 2/2] doc: fix doctest errors --- src/TensorCore.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/TensorCore.jl b/src/TensorCore.jl index e5ac156..ea354f6 100644 --- a/src/TensorCore.jl +++ b/src/TensorCore.jl @@ -20,12 +20,12 @@ For arrays `a` and `b`, perform elementwise multiplication. julia> a = [2, 3]; b = [5, 7]; julia> a ⊙ b -2-element Array{$Int,1}: +2-element Vector{$Int}: 10 21 julia> a ⊙ [5] -ERROR: DimensionMismatch("Axes of `A` and `B` must match, got (Base.OneTo(2),) and (Base.OneTo(1),)") +ERROR: DimensionMismatch: Axes of `A` and `B` must match, got (Base.OneTo(2),) and (Base.OneTo(1),) [...] ``` @@ -74,7 +74,7 @@ For vectors `v` and `w`, the Kronecker product is related to the tensor product julia> a = [2, 3]; b = [5, 7, 11]; julia> a ⊗ b -2×3 Array{$Int,2}: +2×3 Matrix{$Int}: 10 14 22 15 21 33 ``` @@ -164,13 +164,13 @@ and hence may sometimes return another `Adjoint` vector. (And similarly for `Tra julia> M = rand(5,5); v = rand(5); julia> typeof(v ⊡ M') -Array{Float64,1} +Vector{Float64} (alias for Array{Float64, 1}) julia> typeof(M ⊡ v') # adjoint of the previous line -Adjoint{Float64,Array{Float64,1}} +LinearAlgebra.Adjoint{Float64, Vector{Float64}} julia> typeof(v' ⊡ M') # same as *, and equal to adjoint(M ⊡ v) -Adjoint{Float64,Array{Float64,1}} +LinearAlgebra.Adjoint{Float64, Vector{Float64}} julia> typeof(v' ⊡ v) Float64