autograph 0.2.1

A machine learning library for Rust.
Documentation
name: CI
on:
  push:
    branches:
      - main
    paths-ignore:
      - '**.md'
  pull_request:
    branches:
      - "**"
    paths-ignore:
      - '**.md'
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true
env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  CARGO_INCREMENTAL: 0
jobs:
  test:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        include:
        - os: ubuntu-latest
          target: x86_64-unknown-linux-gnu
        - os: windows-latest
          target: x86_64-pc-windows-msvc
        - os: macos-latest
          target: x86_64-apple-darwin
    steps:
    - uses: actions/checkout@v4
    - name: install toolchains
      run: |
        rustup set profile minimal
        rustup toolchain install stable nightly --no-self-update
    - name: build
      run: cargo build --workspace --features serde,iris,mnist,neural-network --all-targets -v
    - name: test
      run: cargo test --workspace --no-default-features --features serde,mnist,neural-network -v
    - name: test avx
      if: ${{ matrix.os != 'macos-latest' }}
      env:
        RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+avx
      run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct
    - name: test fma
      if: ${{ matrix.os != 'macos-latest' }}
      env:
        RUST_BUILD_RUSTFLAGS: -Ctarget-feature=+fma
      run: cargo test --test=integration_tests --no-default-features --features neural-network --target ${{ matrix.target }} -v conv2_direct
    - name: install cargo-careful
      # windows and mac too slow
      if: ${{ matrix.os == 'ubuntu-latest' }}
      run: cargo +nightly install cargo-careful
    - name: careful test
      if: ${{ matrix.os == 'ubuntu-latest' }}
      run: cargo +nightly careful test --test=integration_tests --no-default-features --features neural-network -v
    - name: careful test single-thread
      if: ${{ matrix.os == 'ubuntu-latest' }}
      env:
        RAYON_NUM_THREADS: 1
      run: cargo +nightly careful test --test=integration_tests --no-default-features --features neural-network -v
    - name: install wasm-pack
      if: ${{ matrix.os == 'ubuntu-latest' }}
      run: cargo install wasm-pack -vv
    - name: wasm test
      if: ${{ matrix.os == 'ubuntu-latest' }}
      run: wasm-pack test --headless --firefox -- --no-default-features --features serde,neural-network -vv
      env:
        # conv_direct won't compile without optimization
        RUSTFLAGS: --cfg run_in_browser -C opt-level=1
  krnlc:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    # spirv tools install copied from https://github.com/EmbarkStudios/rust-gpu/blob/main/.github/workflows/ci.yaml
    env:
      spirv_tools_version: "20221024"
      spirv_tools_linux_url: "https://storage.googleapis.com/spirv-tools/artifacts/prod/graphics_shader_compiler/spirv-tools/linux-clang-release/continuous/1863/20221024-094528/install.tgz"
    steps:
    - uses: actions/checkout@v4
    - name: install toolchains
      run: |
        rustup set profile minimal
        rustup toolchain install nightly --no-self-update
        rustup toolchain install nightly-2023-05-27 --component rust-src  rustc-dev  llvm-tools-preview --no-self-update
    - name: install spirv-tools
      run: |
        sudo apt install libwayland-cursor0 libxkbcommon-dev libwayland-dev
        mkdir "${HOME}/spirv-tools"
        curl -fL "$spirv_tools_linux_url" | tar -xz -C "${HOME}/spirv-tools"
        echo "${HOME}/spirv-tools/install/bin" >> $GITHUB_PATH
    - name: install krnlc
      run: cargo +nightly-2023-05-27 install krnlc@0.1.1 --locked -v --no-default-features --features use-installed-tools
    - name: krnlc
      run: krnlc -p autograph -v --check
  lint:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
    - uses: actions/checkout@v4
    - name: install toolchains
      run: |
        rustup set profile minimal
        rustup toolchain install stable --component rustfmt clippy rust-docs --no-self-update
        rustup toolchain install nightly --component rust-docs --no-self-update
        rustup toolchain install nightly-2023-05-27 --component rustfmt clippy rust-src rustc-dev llvm-tools-preview --no-self-update
        rustup toolchain install 1.70.0 --no-self-update
    - name: fmt
      run: cargo fmt --check
    - name: install cargo-hack
      run: cargo install cargo-hack -v
    - name: clippy
      env:
        CARGO_ALIAS_CLIPPYALL: clippy --workspace
      run: |
        cargo hack --feature-powerset --skip default,learn,dataset,iris,mnist clippyall --all-targets -v -- -D warnings -A unexpected_cfgs
        cargo clippy --no-default-features --features iris,mnist --all-targets -v -- -D warnings -A unexpected_cfgs
    - name: rustdoc
      run: |
        cargo rustdoc -p autograph_derive -- -D warnings
        cargo hack --feature-powerset --include-features device,serde,neural-network rustdoc -- --D warnings -A unexpected_cfgs
        cargo rustdoc --all-features -- --D warnings -A unexpected_cfgs
        cargo +nightly rustdoc --all-features -- --D warnings --cfg doc_cfg -A unexpected_cfgs
    - name: msrv
      run: |
        cargo +nightly generate-lockfile -Zmsrv-policy --config "resolver.incompatible-rust-versions='fallback'"
        cat Cargo.lock
        cargo +1.70.0 check -p autograph -p neural-network-mnist-example --all-features --all-targets -v
        cargo +1.70.0 check -p neural-network-benches --all-targets -v
  deny:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
    - uses: actions/checkout@v4
    - uses: EmbarkStudios/cargo-deny-action@v1