easy_rec/python/compat/feature_column/feature_column.py [3005:3040]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if self.ev_params is None:
          embedding_weights = variable_scope.get_variable(
              name='embedding_weights',
              shape=embedding_shape,
              dtype=dtypes.float32,
              initializer=self.initializer,
              trainable=self.trainable and trainable,
              partitioner=self.partitioner,
              collections=weight_collections)
        else:
          # at eval or inference time, it is necessary to set
          # the initializers to zeros, so that new key will
          # get zero embedding
          if os.environ.get('tf.estimator.mode', '') != \
             os.environ.get('tf.estimator.ModeKeys.TRAIN', 'train'):
            initializer = init_ops.zeros_initializer()
          else:
            initializer = self.initializer
          extra_args = {}
          if 'EmbeddingVariableConfig' in dir(variables):
            ev_option = variables.EmbeddingVariableOption()
            ev_option.filter_strategy = variables.CounterFilter(
                filter_freq=self.ev_params.filter_freq)
            extra_args['ev_option'] = ev_option
          else:
            extra_args['filter_options'] = variables.CounterFilterOptions(
                self.ev_params.filter_freq)
          embedding_weights = variable_scope.get_embedding_variable(
              name='embedding_weights',
              embedding_dim=self.dimension,
              initializer=initializer,
              trainable=self.trainable and trainable,
              partitioner=self.partitioner,
              collections=weight_collections,
              steps_to_live=self.ev_params.steps_to_live,
              **extra_args)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



easy_rec/python/compat/feature_column/feature_column_v2.py [3478:3513]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if self.ev_params is None:
      embedding_weights = variable_scope.get_variable(
          name='embedding_weights',
          shape=embedding_shape,
          dtype=dtypes.float32,  # bfloat16,
          initializer=self.initializer,
          trainable=self.trainable and trainable,
          partitioner=self.partitioner,
          collections=weight_collections)
    else:
      # at eval or inference time, it is necessary to set
      # the initializers to zeros, so that new key will
      # get zero embedding
      if os.environ.get('tf.estimator.mode', '') != \
         os.environ.get('tf.estimator.ModeKeys.TRAIN', 'train'):
        initializer = init_ops.zeros_initializer()
      else:
        initializer = self.initializer
      extra_args = {}
      if 'EmbeddingVariableConfig' in dir(variables):
        ev_option = variables.EmbeddingVariableOption()
        ev_option.filter_strategy = variables.CounterFilter(
            filter_freq=self.ev_params.filter_freq)
        extra_args['ev_option'] = ev_option
      else:
        extra_args['filter_options'] = variables.CounterFilterOptions(
            self.ev_params.filter_freq)
      embedding_weights = variable_scope.get_embedding_variable(
          name='embedding_weights',
          embedding_dim=self.dimension,
          initializer=initializer,
          trainable=self.trainable and trainable,
          partitioner=self.partitioner,
          collections=weight_collections,
          steps_to_live=self.ev_params.steps_to_live,
          **extra_args)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



