Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit b2db1b6

Browse files
committed
add remark for discussion on alternatives to using named dimensions directly for operations
1 parent b922289 commit b2db1b6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

rfcs/20210731-tfjs-named-tensors.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,19 @@ interface Dimension<G extends DName, D extends G> {
491491
* Could/should GTensor's be thought of as an extended EINSUM notation? Can
492492
GTensor provide a DSL for easier to understand EINSUM operations?
493493

494+
* Instead of having dimensions apply functions, one could have make GTensor
495+
itself do the multiplication e.g.
496+
497+
```ts
498+
const inputQueries = gtensor.dot(['inputRep'], [input, queryM]);
499+
```
500+
501+
This could still be typechecked, although it would not auto-complete the dimension name ('inputRep'). Another variant that could support auto-completion would be:
502+
503+
```ts
504+
const inputQueries = gtensor.combine([input, queryM]).inputRep.dot();
505+
```
506+
494507
* What should we do with rehape operations? One option is that reshaping is an
495508
operation like renaming, but selects a set of dimensions, and introduces a new
496509
set of dimensions e.g.

0 commit comments

Comments
 (0)