91e2f847f6dd9d57af9276d8d4aeee1e1fdc9030,tensorflow_transform/mappers.py,,apply_vocab,#Any#Any#Any#Any#Any#Any#,373
Before Change
table_size = table.size()
return table.lookup(y), table_size
with tf.name_scope(name, "apply_vocab"):
lookup_fn = lookup_fn or _apply_vocab
result, table_size = api.apply_function(
lookup_fn, x, deferred_vocab_filename_tensor)
// Specify schema overrides which will override the values in the schema
// with the min and max values, which are deferred as they are only known
// once the analyzer has run.
//
// `table_size` includes the num oov buckets. The default value is only used
// if num_oov_buckets > 0.
min_value = tf.constant(0, tf.int64)
max_value = table_size - 1
if num_oov_buckets <= 0:
min_value = tf.minimum(min_value, default_value)
max_value = tf.maximum(max_value, default_value)
api.set_tensor_schema_overrides(result, min_value, max_value)
return result
def segment_indices(segment_ids, name=None):
Returns a `Tensor` of indices within each segment.
segment_ids should be a sequence of non-decreasing non-negative integers that
After Change
lookup_fn=None,
name=None):
rSee `tft.apply_vocabulary`.
return apply_vocabulary(
x=x,
deferred_vocab_filename_tensor=deferred_vocab_filename_tensor,
default_value=default_value,
num_oov_buckets=num_oov_buckets,
lookup_fn=lookup_fn,
name=name)
def segment_indices(segment_ids, name=None):
Returns a `Tensor` of indices within each segment.
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 5
Instances
Project Name: tensorflow/transform
Commit Name: 91e2f847f6dd9d57af9276d8d4aeee1e1fdc9030
Time: 2018-06-12
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/mappers.py
Class Name:
Method Name: apply_vocab
Project Name: rwth-i6/returnn
Commit Name: db8867190494f2dc7cebb7203978770458cc23c8
Time: 2021-03-12
Author: albzey@gmail.com
File Name: returnn/tf/layers/base.py
Class Name: LayerBase
Method Name: get_batch_dim
Project Name: tensorflow/models
Commit Name: f2ea2f537967af92fd47eeeb91b0e312aedaddad
Time: 2019-05-24
Author: tobyboyd@google.com
File Name: official/transformer/v2/transformer_main.py
Class Name: TransformerTask
Method Name: eval
Project Name: rlworkgroup/garage
Commit Name: 6c6331df007fb155331c2fac0107b412ab62d943
Time: 2019-09-21
Author: ahtsans@gmail.com
File Name: src/garage/tf/policies/continuous_mlp_policy.py
Class Name: ContinuousMLPPolicy
Method Name: get_action_sym
Project Name: tensorflow/transform
Commit Name: 91e2f847f6dd9d57af9276d8d4aeee1e1fdc9030
Time: 2018-06-12
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/mappers.py
Class Name:
Method Name: string_to_int