Skip to content

Commit

Permalink
add custom op demo
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxudong committed Oct 21, 2023
1 parent efa5683 commit 03b9868
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/source/component/custom_op.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ model_config: {
}
keras_layer {
class_name: 'EditDistance'
st_params {
fields {
key: 'text_encoding'
value: { string_value: 'latin' }
}
}
}
}
blocks {
Expand Down
2 changes: 1 addition & 1 deletion easy_rec/python/layers/keras/custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
curr_dir, _ = os.path.split(__file__)
parent_dir = os.path.dirname(curr_dir)
ops_idr = os.path.dirname(parent_dir)
ops_dir = os.path.join(ops_idr, 'python', 'ops')
ops_dir = os.path.join(ops_idr, 'ops')
if 'PAI' in tf.__version__:
ops_dir = os.path.join(ops_dir, '1.12_pai')
elif tf.__version__.startswith('1.12'):
Expand Down
Binary file modified easy_rec/python/ops/1.12/libedit_distance.so
Binary file not shown.
Binary file modified easy_rec/python/ops/1.15/libedit_distance.so
Binary file not shown.

0 comments on commit 03b9868

Please sign in to comment.