40 Commits

Author SHA1 Message Date
Tianqi Chen 275114b327 [REFACTOR][IR] Unify PrimExpr with Expr typed view (#19910)
## Summary
- Make `PrimExpr` a typed C++ view over `Expr` values whose
`ExprNode::ty` is `PrimType`, instead of using a separate runtime node
class as the proof of primitive-ness.
- Use the shared `ir::Call` node for Relax, TIRX, and primitive-valued
calls, while keeping primitive-only APIs explicit at their semantic
boundaries.
- Keep Python on the general `Expr` surface for primitive-typed values
so `isinstance` behavior does not imply a nominal primitive-expression
subclass.

## Design Rationale
The main advantage of this change is that common expression nodes such
as `Call` can be unified without specializing each one to `PrimType`. A
single `ir::Call` can represent a Relax tensor call, a Relax scalar
call, or a primitive-valued intrinsic call; the result type stored in
`ExprNode::ty` determines whether that particular value can be viewed as
`PrimExpr`.

This keeps the IR node hierarchy focused on expression structure rather
than result-type categories. Nodes that are intrinsically primitive,
such as integer and floating-point literals or TIRX primitive operators,
still have strongly typed C++ APIs and data structures. General nodes
whose result type may vary, such as `Call`, remain general `Expr` nodes
and are narrowed to `PrimExpr` only where primitive-only semantics are
required.

The PR also keeps the compatibility surface practical: C++
primitive-only APIs continue to accept `PrimExpr`, Python exposes a
compatibility predicate for checking the primitive typed category, and
visitors/printers use one natural `Call` path rather than duplicating
Relax and primitive call handling. Missing expression types are
represented explicitly with `Type::Missing()` so constructors can leave
type inference to later analysis without relying on nullable `Type`
values.
2026-07-01 18:55:33 -04:00
Tianqi Chen 1e1920bcbd [REFACTOR][IR] Unify PrimExpr type mechanism to PrimType instead of DataType (#19875)
In the past we have been using `DataType` in PrimExpr.dtype field to
check type information for PrimExpr while still having BaseExpr.ty for
richer type information. DataType is also used both in runtime and
compiler. This PR streamlines the boundary:

- PrimExpr.ty now carries PrimType that replaces original use of
`DataType`
- Runtime use will now favor DLPack DLDataType, removing one layer of
indirection.
- Constants attributes where values are usually runtime values, will use
`DLDataType`
- DataType will be phased out after this PR

We also brings up helper functions in PrimType, but also limits them to
a more concise set so the functions do not grow with the data type codes
in DLPack.

This is a major refactor that changes the IR primitive. It helps to
bring possible future benefits:
- Unified type mechanism through Expr.ty
- Possibility of carry future Type nodes 

Migration Guide:
- Use `PrimType` when code reasons about compiler expression types,
tensor element compiler types, or constructs a `PrimExpr`/compiler type.
- Use existing source types such as `expr.ty()`, `ExprOp.expr_ty()`, or
TE tensor element `dtype` where possible instead of rebuilding a type
from dtype text.
- Use raw `DLDataType` for runtime constants, ABI paths, dtype-valued
attrs, and storage/runtime helper logic.
- Prefer direct `PrimType` equality, `MatchesCode(...)`,
`MatchesElementType(...)`, and `WithCode(...)` over local wrappers or
string dtype checks.

Performance:

Using Object type instead of DLDataType would indeed bring some
performance impact to the IR. We have done the following performance
optimizations:
- Make sure most of the outputs reuse one of the PrimType from inputs
- Cache a thread local PrimType based on input so we don't repeatly
realloc

We did benchmarks show that rewrite simplify operation stays within
+-10% overhead of original one. Which merits the refactor given the
benefit the unfication brings
2026-06-24 21:31:47 -04:00
Tianqi Chen 878903f574 [REFACTOR][IR] Delete class Bool and class Integer boxed-type wrappers (#19636)
## Background

`class Integer : public IntImm` and `class Bool : public IntImm` were
thin
wrappers sharing `IntImmNode` with no separate node class and no FFI
registration. They existed to provide implicit int→Integer constructors
and
a `.IntValue()` / `operator bool()` accessor, but the same functionality
is
available directly through `IntImm`.

## What this PR does

Migrates all call sites away from `Integer` / `Bool` and then deletes
the
class definitions.  The changes are split into four commits, each
independently buildable:

**Commit 1 – [REFACTOR][TIR]** Replace IR-position `Integer(N)` /
`Bool(b)`
constructors with `IntImm(DataType::Int(32), N)` /
`IntImm(DataType::Bool(), b)`
across ~62 source files (arith, relax analysis, s_tir schedule state,
transform
passes, codegen).

**Commit 2 – [REFACTOR][SCHEDULE]** Migrate `Schedule` and
`MetaSchedule`
trace-boxing code: `Integer(N)` attrs in `TracedSchedule` →
`IntImm(DataType::Int(32), N)`;
`ffi::Array<Integer>` schedule-rule parameters → `int64_t`; `Bool(b)`
attrs →
`IntImm(DataType::Bool(), b)`.

**Commit 3 – [REFACTOR][TOPI]** Migrate topi container signatures
(`ffi::Array<Integer>` → `ffi::Array<int64_t>`) and update all internal
usages (`.IntValue()` → plain int64_t, `.defined()` → removed,
`->value` → direct indexing).  Also handles stray `Integer` / `Bool`
variables in clml codegen, make_packed_api, infer_layout_utils, and
relax distributed code.

**Commit 4 – [REFACTOR][IR]** Delete `class Bool`, `class Integer`,
`TypeTraits<Bool>`, and `TypeTraits<Integer>` from
`include/tvm/ir/expr.h`.

## Canonical replacements

| Old | New |
|-----|-----|
| `Integer(N)` | `IntImm(DataType::Int(32), N)` |
| `Bool(b)` | `IntImm(DataType::Bool(), b)` |
| `x.IntValue()` | `x->value` |
| `x` as bool | `x->value != 0` |
| `ffi::Array<Integer>` | `ffi::Array<int64_t>` |

## Testing

- All 118 C++ unit tests pass (`./cpptest`)
- `tests/python/s_tir/` — 1251 passed (14 pre-existing failures
unrelated to this change, all in TIR transform tests with
annotation-mismatch errors)
- `tests/python/relax/` — passes (excluding pre-existing
torch/torchvision import failures in frontend tests)
2026-05-29 09:48:37 -04:00
Tianqi Chen 141c22fd8a [Refactor] Bring up tirx namespace (#18913)
This PR brings up the tirx namespace. We have been spliting out the
original tir namespace to include high-level component s_tir and this PR
updates the remaining low-level part as tirx namespace
2026-03-19 21:27:54 -07:00
YinHanke 14e41c681a [Relax][ONNX] Support dynamic repeats for Tile (#18878)
## Summary

Support dynamic `repeats` for ONNX Tile in the Relax frontend.

## Changes

- add a dynamic Tile conversion path for ONNX when `repeats` is a graph
input
- expose `topi.dyn_tile` to the Python/packed TOPI interface
- add frontend tests for dynamic `repeats`

## Validation

- `tests/python/relax/test_frontend_onnx.py -k test_tile_dynamic_repeats
-q`
- local end-to-end repro matches ONNX Runtime

## Issue
Fixes #18752
2026-03-05 23:38:32 -05:00
Tianqi Chen 9a8320acbd [LINT][PYTHON] Modernize annotations with ruff UP rules (#18830)
This PR enables ruff pyupgrade (UP) rules with py310 target, auto-fixing
~5600 annotation modernizations (PEP 585 generics, PEP 604 unions,
deprecated typing imports).

Also removes from __future__ import annotations from ir/module.py and
rmsnorm.py, bumps requires-python to >=3.10, and removes absolute_import
aliases from topi/contrib files.
2026-02-27 21:29:47 -05:00
Tianqi Chen 33dcea1686 [REFACTOR][LINT] Modernize ruff config (#18810)
This PR removes the extra lint violations from the codebase so lint
aligns with the latest style
2026-02-23 07:29:21 -05:00
Tianqi Chen aa2e609136 [LINT] Modernize lint to use pre-commit hooks (#18807)
This PR migrates existing lint to use pre-commit hooks
2026-02-22 11:03:21 -05:00
Tianqi Chen 3c36ce2ec6 [FFI][REFACTOR][ABI] Rename NDArray to Tensor (#18275)
This PR Updates the NDArray => Tensor.

Both tensor and ndarray are commonly used terms.

Because the term Tensor is getting more common in the context of ML,
we do the rename to stay more aligned with torch.Tensor and DLTensor.
2025-09-06 14:33:59 -07:00
Youngsik Yang 79368cea1a [Relax][ONNX][Transform] Add mode choice, new mode, and warning for take() (#18061)
[Relax][Transform] Add mode choice, NaN mode, and warning for take()

- Add a `mode` parameter to Relax’s `take()`
- Add `NaN` mode to `take()`
- Add unit tests covering all `take()` modes
- Add a warning log for `fast` mode
- Unify default modes in lower layers to `fast` for consistency with Relax
2025-07-08 19:58:35 +08:00
kavin-mcw fa46d7a0bc Add support for hamming_window op (#18036)
* Add support for hamming_window

* Add testcase for exportedProgram

* move key-value pair in exportedProgram to correct place

* Fix lint issue

* Changed default periodic value to True

* Fix lint issue
2025-06-11 22:36:05 +08:00
Qingchao Shen 55b8980a3e [TOPI] Fix index handling in expand_like operator for axis expansion (#18006) 2025-06-01 20:22:09 +09:00
Hugo Latendresse b5b0337568 [Relax][PyTorch] support for index.Tensor (#17836)
New op for advanced indexing + unit tests
2025-04-21 10:59:51 -04:00
Pratheesh-04-MCW c00f52a70d [Relax][PyTorch] Add Stack Op Support for Exported Program (#17819)
* add op support for stack

* trailing whitespace issue fixed

* fixed lint issues

* fixed whitespace issue

* fixed lint error

* fixing lint issues

* fixed whitespace issue

* add test script for fx_graph

* fix lint issues

* fixed unity check issues

* unity check

* fixed unity check issues

* lint issues
2025-04-18 10:03:12 +08:00
Tianqi Chen c81fccaa2f [REFACTOR] Phase out te.Schedule c++ components (#17662)
* cleanup schedule c++

* remove vitis ai

* remove VERILATOR

* remove aocl and sdaccel

* remove opengl

* remove microdev and antlr

* remove frontends

* fix

* Cleanup relay related legacy components

* fix

---------

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-17 17:03:09 -05:00
Tianqi Chen a531d170b9 [REFACTOR] Phase out relay c++ components (#17660)
* cleanup relay c++

* [REFACTOR] Phase out relay c++ components

This PR phases out the relay C++ components and
simplifies the overall codegen runtime logic.

---------

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-17 22:21:37 +08:00
Tianqi Chen 9f846bda5b [REFACTOR] Phase out te.schedule python components (#17658)
* [REFACTOR] Phase out te.schedule python components

This PR phases out te.schedule python components.
te.compute is kept around for future usages.
tir.Schedule is a more modern version of the scheduling that we can use onwards.

Doing so also helps us to cleanup the testcases that relies on
explicit full build and execution. As we move future unit testcases
towards structural equality based unit tests.

* Simplify CI to focus on UT

The main rationale is that we should only have very few target
dependent UT in tests/python/codegen and possible
a new category in future for op-level integration if needed.

* Re-enable wasm

* fix lint

* remove hybrid,sparse autodoc and remove tests

---------

Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>
2025-02-16 17:13:10 +08:00
Siyuan Feng 59a2256959 [Relax] Add gather_elements and gather_nd operators (#17523)
Add gather_elements and gather_nd operators to Relax and corresponding
ONNX frontend.
2024-11-13 10:29:03 -05:00
PatrikPerssonInceptron 0d5bde59de [FIX][TOPI][strided_slice] Fix topi.strided_slice output shape (#17502)
* updated topi.strided_slice to perform the same canonicalize index as
relax.strided_slice given a assume_inbound flag

* applied formatting

* removed debug statements

* set assume_inbound=True in leg_redistribute_replica_to_shard as this is assumed
in the associated unit tests

moved misplaced function description

fixed shape error and added a assume_inbound=True to test_strided_slice_symbolic_sliced_axis

added param description for assume_inbound

* added doc for param assume_inbound in dynamic_strided_slice

* added # fmt: off and # fmt: on
2024-11-12 15:48:57 +08:00
tqchen d159f73d2a [MERGE] Merge main into unity 2023-05-14
Merge remote-tracking branch 'upstream/main' into unity
2023-05-15 09:50:33 -04:00
Krzysztof Parzyszek 48200fc3d7 [TOPI] Use f-strings for string formatting, NFC (#14822)
* [TOPI] Use f-strings for string formatting, NFC

Replace uses of % and .format() with f-strings.

* Format updated files
2023-05-11 16:13:10 +09:00
Sunghyun Park 7db0b984de [Unity][Op] Dynamic Strided Slice (#14548)
* feat: dyn_strided_slice op

* feat: shape computation

* feat: legalizer for dynamic strided slice

* remove whitespace

* reflect feedback

* fix

* fix

* remove whitespace
2023-04-13 05:04:04 +09:00
AndrewZhaoLuo e5ae4347dd [CUDA][Schedule] Better Layout Transform Schedules (#14167)
* initial basis

* Generated all the tile sizes

* is this all you need?

* linting

lint

move schedule rule to own file

lint p2

layout transform fixings

* forgot to forward arg

* fix tests

* reduce search space

* lint

* schedule rule documentation

* add a note

* fix wording

* handle implicit reshape case v1

* clean up comments

* address comments

* testing harness

* more progress on testing harness

* fix case where shape changes in mod

* inline after schedule genreation to help analysis

* proper autoinlining INTO layout transform block to maintain extants

* clean up

* reindex for introducing cache block

* reorganize testing

* more cleanup

* remove forced false

* use the proper dispatcher

* update test, make default schedule rule None

* linting

* fix mypy errors

* clean up

* manual test cases

* manual tests

* add comment, fix improper implicit reshape handling

* fix

* remove extra comments

* more lints

* refactor

* remove extraneous check

* lint again :/

* remove uneeded newline

* remove leading spaces
2023-03-23 16:44:16 -07:00
Jiawei Liu 100c050d60 [Relay] fix: trilu check op for i64/i32 (#13123)
* fix: trilu check op for i64/i32

* format
2022-10-21 15:32:20 +09:00
Jiawei Liu 3d22dbffd0 [Relay] fix: add compute tag for trilu (#13120)
fix: add compute tag for trilu
2022-10-19 04:26:46 +09:00
Yulv-git bdcfa01eae [Fix] Fix some typos (#11503)
Fix some typos in src/.

Co-authored-by: driazati <driazati@users.noreply.github.com>
2022-08-19 16:31:30 -07:00
Josh Fromm b8893b557a [Relay][Op] Trilu operator implementation (#12124)
* Added topi trilu implementation

* Implemented and tested full Trilu op.

* Fix test type.

* Add tril zero tests.

* Add pytorch trilu integration.

* Clean up torch integration.

* Readded skip for zero tests.
2022-08-02 13:48:59 -06:00
Gus Smith 9160dc4a4a Add sliding_window operator (#9816)
* Add windows operator

* remove TODO

* Convert ICHECKs to CHECKs

* Report errors using diagnostic context

* Use more readable CHECKs

* Remove example; move comments to test

* Revert "Remove example; move comments to test"

This is a partial revert.

This reverts commit c810c2db7637ce9537adc49d1016caddd5093d3a.

* Add newline to fix Sphinx error

* windows -> sliding_window

* whitespace

* fmt
2022-01-12 12:38:52 +09:00
Lunderberg d9fe67259e [Docs] Prevented docs/1 file from being generated. (#8029)
* [Docs] Prevented docs/1 file from being generated.

Typo in tests/scripts/task_sphinx_precheck.sh caused $TVM_HOME/docs/1
file to be created with stderr output, rather than merged stderr and
stdout.

* [Docs] Corrected sphinx build warnings

- Previously, several warnings were generated by sphinx, but were
  unintentionally suppressed.  This PR resolves the sphinx warnings.

* [Docs] Corrected additional sphinx build warnings.

- Rebased on main and corrected warnings, now up to date as of commit
  53e4c603.

* [Docs] Corrected additional sphinx build warnings

- Rebased on main and corrected warnings, now up to date as of commit
  1f2ca068c.

* [Docs] Corrected additional sphinx build warnings

- Rebased on main and corrected warnings, now up to date as of commit
  d0791d3db.

* [Docs] Ignore sphinx warnings from missing "git describe" and sckit-learn versions.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
2021-06-24 10:27:29 -04:00
cailun01 13146be7cf [TensorFlow][Frontend] Adding InversePermutation Op (#8277)
* [TensorFlow][Frontend] Adding InversePermutation Op

Computes the inverse permutation of a tensor. This Op is used by Mask R-CNN
or other object detection models.

* uncomment test_read_variable_op

* restore several tests

* fix lint error

* fix python linting error

* fix lint error

* restore mistakenly deleted codes
2021-06-22 06:32:27 +09:00
masahi cbe3dcad5e [Relay, TOPI] Refactor strided_slice and add axes argument (#8165)
* Initial import

commit 667011f10320918e4dcd47ac2b57fe49849e5440
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Thu May 27 16:28:57 2021 +0900

    Squashed commit of the following:

    commit 95242d86ea5de96925430c0a74b6e91e299fb5ab
    Author: Masahiro Masuda <masahi129@gmail.com>
    Date:   Thu May 27 15:45:19 2021 +0900

        Add function attribute for shape func for profiling

commit b8ede24ff987eb152bde7cc15afce004a88aeb5f
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Thu May 27 10:21:06 2021 +0900

    layout transform support complete

commit 5782b7070288eb0de122f5dab91b38c26166a7d7
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Thu May 27 08:31:11 2021 +0900

    support layout transform part1

commit e94aa6b2a916607234c89eddcd07afdfa8085786
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 19:47:46 2021 +0900

    moved utilities to its own file

commit 8bf88913b9bc02730120a0695138ed3fb8ed49ae
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 17:39:50 2021 +0900

    fix format

commit e89d599d6a10021167feb241483693260aa535f2
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 17:33:02 2021 +0900

    ToVec -> ConvertToVec

commit 001982ce1419504f1f0e1d116d57dd34f0180008
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 17:26:56 2021 +0900

    format

commit fae57f9bd67b29880a7552b5149d03120924cdac
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 17:24:35 2021 +0900

    use Any for relay type rel path

commit 053eee2e6f58749af0b68cca52fd530afc0f6454
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 17:14:44 2021 +0900

    fix

commit fbb099c8e66caf846c773e180c66a2b336bd64a3
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 16:39:37 2021 +0900

    refactor type rel

commit ecfe3cd43e3968375505d5393959ec19da4b5c01
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 16:23:47 2021 +0900

    working

commit b357c2f8825603d8ba9ee2424a7f572e12c29852
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 16:07:07 2021 +0900

    refactoring output shape calc

commit f69ef407cf003c7977a4564185949d3f6b5c0219
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 14:23:36 2021 +0900

    bug fix end param init

commit a5611c9a1f243f4b9a56539e7e8a15661374920c
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 13:42:31 2021 +0900

    fix test shape

commit e79931a264f0d8ed63a333ec4ab10a72cff22a84
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 13:42:03 2021 +0900

    dyn slice tests left as todo now work

commit 7db4cea31378eed85dfae1cb03fb5a97394f7fe3
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 13:36:30 2021 +0900

    remove dynamic input specific op

commit 510bce6a181604e5eb3f2bd1951ae035a4090700
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 12:52:30 2021 +0900

    refactoring dynamic slice

commit 1b3969ade9ee98651b8157ecab1c675410a84ee5
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 09:06:46 2021 +0900

    fix slice axes dispatch

commit 9a795606fb71ec08cefe5bfa904f1ab32c18da4b
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 08:32:54 2021 +0900

    refactor compute

commit 80442f86bbf9f0582823d5903021e3bae61a4662
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 08:11:18 2021 +0900

    fixed output shape, refactored version working

commit d2538ae980a1c731b646467c615d742efeb65e25
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 07:56:05 2021 +0900

    restore another slice variant

commit 36aa777eacd8426a850d08b528e9addcd36a4894
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Mon May 24 06:41:50 2021 +0900

    refactoring slice with axes

commit 32698b74df211829777e5493e82bf7425364acb4
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Sat May 22 13:11:01 2021 +0900

    fix axes null check

commit 54fb723d23d351551b75d879198aafb1eac2dede
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Sat May 22 12:52:18 2021 +0900

    Revert "[Bugfix][Vulkan] Call VulkanDeviceAPI destructor on program exit (#7997)"

    This reverts commit 58c3413a30.

commit 37eaf579d47190bc42ad64f9ac34c93a9dac3ce5
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Sat May 22 04:30:37 2021 +0900

    remove wip layout transform support for slice with axes

commit 9bcb2ada60fadadd1f29a6d09e6b4fc5104efd3f
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 18:01:59 2021 +0900

    fix pylint

commit 7063a09ef1b98849e98194e8a9e47455cd1b5fa3
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 17:57:03 2021 +0900

    minor fix

commit 96c9231b5b2cbf2f36b4096d54f1f5ac4033d361
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 17:54:16 2021 +0900

    support dynamic scatter nd

commit d4a4db8a8b518b1ef9e6abacfa23a9e1b76fd1b0
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 17:33:19 2021 +0900

    gather_dim -> num_indices_per_tuple

commit a489375f0b31948a13e41f5967960305453c7049
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 17:23:46 2021 +0900

    add dynamic gather_nd test

commit 533854a006c16359842451b8690cb8639b47635d
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 17:18:26 2021 +0900

    refactor gather_nd ref funcs

commit 36a4501a151070760559f6ce4cfa574202b4d0c8
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 14:36:34 2021 +0900

    add gather_nd shape func

commit 1853c35d883e501e484d5f74adb3081f916761d5
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Sat May 22 04:20:39 2021 +0900

    add eyelike support

commit 150e945290cbc595bd370dcae7e96e24597fbf04
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 04:08:37 2021 +0900

    migrating inlined topi compute to topi/transform.h

commit 763ac37f725c2cb89a3221621b69da0e6ac39ed8
Author: Masahiro Masuda <masahi129@gmail.com>
Date:   Fri May 21 03:45:37 2021 +0900

    strided slice with axes support

* fix bad merge

* fix cpplint

* fix pylint

* more cpplint fix

* fix compiler warning

* add doc

* add tests

* typo fixed

* support axes argument in topi cpp strided slice

* Properly test axes argument in relay tests

* fix bad merge (revert vm change)

* fix tests
2021-06-03 06:33:00 +09:00
Xingyu Zhou ae31a3399b [Frontend][Tensorflow]add batch_dim support for gatherV2 (#7951)
* add batch_dim support

* fix lint

* add check for num of arguments for topi.take

* fix gpu test cases

* add check for batch_dims in take_grad
2021-05-05 09:37:00 -07:00
Matthew Brookhart f974166c4d Don't fuse take with dynamic inputs (#6979)
* add a regression test for fusing dynamic take

* add legalize for take that stops fusion on dynamic inputs

* fix lint

* fix typo
2020-11-26 15:46:59 +09:00
Matthew Brookhart a7b22ab9ba Dynamic gpu tests, add dynamic strided slice to topi (#6870)
* enable GPU tests for dynamic ops

* strided-slice can't do 0-sized output tensors, remove test

* move dynamic strided slice into topi

* add python interface to topi dynamic strided slice

add python interface, tests

* autoformat

* fix bad copy/paste

* fix doc string

* disable topk on gpu for now, remove invalid slice test
2020-11-11 15:58:23 -08:00
Tianqi Chen c8064b3ca6 [REFACTOR] Remainings of util => utils (#6778) 2020-10-29 13:46:31 -04:00
Rishabh Jain 39c4719760 [Relay/TOPI] Added 'offsets' and 'alignment' attributes to MATRIX_SET_DIAG. (#6429)
* [Relay/TOPI] Added 'offsets' and 'alignment' attributes to MATRIX_SET_DIAG.

* Added support for 'offsets' and 'alignment' attributes of MATRIX_SET_DIAG.
  (Similar to MATRIX_SET_DIAG V3 of TF)
* Added tests for 'offsets' and 'alignment' attributes of MATRIX_SET_DIAG.

* Changes by black.

* * Added offset check in Relay.
* Minor changes.

* Added more tests and some minor documentation changes.
2020-09-24 08:43:28 -07:00
Jared Roesch f13fed55cf [Format] Convert all Python code w/o CI (#6448)
* Add black setup

* Tweak pyproject.toml

* Fix syntax issues

* Fix

* Tweak

* Black all Python code
2020-09-11 22:17:24 +09:00
Yao Wang 122811137a [Relay][Topi][Op]Advanced indexing (#6388)
* Add Relay adv_index op

* Support single index tensor dynamic shape

* Support more dynamic index

* Fix lint

* Minor fix for comment

* Fix lint

* Fix lint

* Fix test

* Fix
2020-09-10 23:09:45 -07:00
Rishabh Jain 082f27ebf8 [Relay/TOPI][TFLite] Implemented MATRIX_SET_DIAG Operator for Relay/TOPI and TFLite Frontend. (#6303)
* Corrected docstring error.

* Minor changes.

* Changed MATRIX_SET_DIAG registration from broadcast to injective.
2020-08-27 11:21:45 +08:00
Tianqi Chen 0a4ee30da7 [REFACTOR] topi -> tvm/topi (#6186)
This PR migrates the topi library as a sub namespace of tvm.
2020-08-02 09:29:29 -07:00