In the model serving (internal), we require the features to have at least 1 dimension (batch size) if used as document features. Currently we have multiple use cases of such and have to manually add a dimension to query and usr fields. This RB expose two params to control whether to add dimension to these placeholders.
Fixes # (issue)
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
List all changes
Added option add_first_dim_for_query_placeholder and add_first_dim_for_usr_placeholder for query and usr features respectively.
In train_helper.py, get_query, if add_first_dim_for_query_placeholder is True, then the placeholder created will have shape [None] instead of []. The placeholder is then squeezed internally to work with rest of the graph. Similar logic added in get_usr_fields
Refactored input signatures for get_query, get_doc_fields, and get_usr_fields.
Fixed run_detext.sh PYTHONPATH
Testing
Tested with run_detext.sh and inspected the output:
With add_first_dim_for_query_placeholder=True and add_first_dim_for_usr_placeholder=True, the signatures are:
With add_first_dim_for_query_placeholder=False and add_first_dim_for_usr_placeholder=False (this is the default, and same as before), the signatures are:
Description
In the model serving (internal), we require the features to have at least 1 dimension (batch size) if used as document features. Currently we have multiple use cases of such and have to manually add a dimension to query and usr fields. This RB expose two params to control whether to add dimension to these placeholders.
Fixes # (issue)
Please delete options that are not relevant.
List all changes
add_first_dim_for_query_placeholder
andadd_first_dim_for_usr_placeholder
for query and usr features respectively.train_helper.py
,get_query
, ifadd_first_dim_for_query_placeholder
is True, then the placeholder created will have shape [None] instead of []. The placeholder is then squeezed internally to work with rest of the graph. Similar logic added inget_usr_fields
get_query
,get_doc_fields
, andget_usr_fields
.run_detext.sh
PYTHONPATHTesting
Tested with
run_detext.sh
and inspected the output: Withadd_first_dim_for_query_placeholder=True
andadd_first_dim_for_usr_placeholder=True
, the signatures are:With
add_first_dim_for_query_placeholder=False
andadd_first_dim_for_usr_placeholder=False
(this is the default, and same as before), the signatures are:Test Configuration:
Checklist