[POT] Update patterns (#9786)
* Update special_patterns.py * add pattern in docs
This commit is contained in:
1 parent
cf49cd6ce8
commit
17c394c8fe
2 files changed
+21
No files matched your search
@@ -347,6 +347,18 @@ graph TB
|
||||
|
||||
---
|
||||
|
||||
**Name:** softmax<br/>
|
||||
**Pattern:** <br/>
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
exp(Exp) --> reduce(ReduceSum)
|
||||
exp(Exp) --> divide(Divide)
|
||||
reduce_const(Const) --> reduce(ReduceSum)
|
||||
reduce(ReduceSum) --> divide(Divide)
|
||||
```
|
||||
---
|
||||
|
||||
**Name:** softmax_reshape_matmul<br/>
|
||||
**Pattern:** <br/>
|
||||
|
||||
|
||||
@@ -144,6 +144,15 @@ def create_softmax_pattern():
|
||||
return pattern.set_name('softmax').pattern
|
||||
|
||||
|
||||
@registry_ignore_patterns('blocks')
|
||||
def create_softmax_div_pattern():
|
||||
pattern = PatternBuilder()
|
||||
exp_out = pattern.append_single_op('Exp', 'exp').get_last_node()
|
||||
reduce_out = pattern.append_op_const('ReduceSum', 'reduce').get_last_node()
|
||||
pattern.insert_single_op([exp_out, reduce_out], None, 'Divide', 'div')
|
||||
return pattern.set_name('softmax_div').pattern
|
||||
|
||||
|
||||
@registry_ignore_patterns('blocks')
|
||||
def create_softmax_reshape_matmul_pattern():
|
||||
pattern = PatternBuilder()
|
||||
|
||||
Reference in new issue
Block a user