Skip to content

Commit 85ffb94

Browse files
authored
Update custom_ops.md (microsoft#795)
add domain for SentencePiece Op
1 parent 711a2cf commit 85ffb94

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/custom_ops.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ node = onnx.helper.make_node(
449449
outputs=['indices', 'output'],
450450
mapping_file_name='vocabulary.txt',
451451
unmapping_value="unknown_word",
452-
model=model
452+
model=model,
453+
domain='ai.onnx.contrib'
453454
)
454455

455456
inputs = np.array(["Hello world", "Hello world louder"], dtype=object),
@@ -459,8 +460,8 @@ add_bos = np.array([0], dtype=np.bool_),
459460
add_eos = np.array([0], dtype=np.bool_),
460461
reverse = np.array([0], dtype=np.bool_)
461462

462-
tokens = array([17486, 1017, 17486, 1017, 155, 21869], dtype=int32)
463-
indices = array([0, 2, 6], dtype=int64)
463+
tokens = np.array([17486, 1017, 17486, 1017, 155, 21869], dtype=np.int32)
464+
indices = np.array([0, 2, 6], dtype=np.int64)
464465

465466
expect(node, inputs=[inputs, nbest_size, alpha, add_bos, add_eos, reverse],
466467
outputs=[tokens, indices], name='sp')
@@ -1597,4 +1598,4 @@ def run_add_f():
15971598
}
15981599
out = sess.run(None, ort_inputs)[0]
15991600
```
1600-
</details>
1601+
</details>

0 commit comments

Comments
 (0)