[Tripy] Add __len__
for tp.Shape
and infer length statically when possible
#45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tripy CI | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [synchronize, opened, reopened, ready_for_review] | |
paths: ['tripy/**'] | |
env: | |
DEFAULT_IMAGE: ghcr.io/nvidia/tensorrt-incubator/tripy:latest | |
NEW_TEST_IMAGE: test-image:latest | |
jobs: | |
tripy-l0: | |
if: github.event.pull_request.draft == false | |
runs-on: tripy-self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
new_container: | |
- 'tripy/Dockerfile' | |
- 'tripy/pyproject.toml' | |
- if: steps.filter.outputs.new_container == 'true' | |
run: echo "l0_image=${{ env.NEW_TEST_IMAGE }}" >> "$GITHUB_ENV" | |
- if: steps.filter.outputs.new_container != 'true' | |
run: echo "l0_image=${{ env.DEFAULT_IMAGE }}" >> "$GITHUB_ENV" | |
- name: build-new-container | |
if: steps.filter.outputs.new_container == 'true' | |
uses: docker/build-push-action@v6 | |
with: | |
context: tripy/ | |
tags: ${{ env.NEW_TEST_IMAGE }} | |
push: false | |
- name: run-test | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ${{ env.l0_image }} | |
options: --gpus all -v ${{ github.workspace }}/tripy:/tripy | |
run: | | |
python3 docs/generate_rsts.py | |
sphinx-build build/doc_sources build/docs -c docs/ -j 6 -W | |
pytest --cov=tripy/ --cov-config=.coveragerc tests/ -v -m "l0 or not l1" --durations=15 |