def _get_model_spec(self, features, labels, mode):
    features = features.copy()
    if (mode == tf.estimator.ModeKeys.PREDICT):
        fids = tf.IndexedSlices(indices=features.pop('fids_indices'), values=features.pop('fids_values'), dense_shape=features.pop('fids_dense_shape'))
        features.update(self._preprocess_fids(fids, self._slot_configs))
    bias_embedding = embedding.Embedding(self._bias_slot_configs, devices=self._embedding_devices)
    bias_tensor = bias_embedding.lookup(features)
    if (self._vec_slot_configs is not None):
        vec_embedding = embedding.Embedding(self._vec_slot_configs, devices=self._embedding_devices)
        vec_tensor = vec_embedding.lookup(features)
    else:
        vec_embedding = None
        vec_tensor = None
    model = SparseFLModel(self._role, self._bridge, features.get('example_id', None), config_run=False, bias_tensor=bias_tensor, bias_embedding=bias_embedding, vec_tensor=vec_tensor, vec_embedding=vec_embedding, feature_columns=self._feature_columns)
    spec = self._model_fn(model, features, labels, mode)
    assert model._frozen, 'Please finalize model in model_fn'
    return (spec, model)
def _get_model_spec(self, features, labels, mode):
    features = features.copy()
    if (mode == tf.estimator.ModeKeys.PREDICT):
        fids = tf.IndexedSlices(indices=features.pop('fids_indices'), values=features.pop('fids_values'), dense_shape=features.pop('fids_dense_shape'))
        features.update(self._preprocess_fids(fids, self._slot_configs))
    bias_embedding = embedding.Embedding(self._bias_slot_configs, devices=self._embedding_devices)
    bias_tensor = bias_embedding.lookup(features)
    if (self._vec_slot_configs is not None):
        vec_embedding = embedding.Embedding(self._vec_slot_configs, devices=self._embedding_devices)
        vec_tensor = vec_embedding.lookup(features)
    else:
        vec_embedding = None
        vec_tensor = None
    model = SparseFLModel(self._role, self._bridge, features.get('example_id', None), config_run=False, bias_tensor=bias_tensor, bias_embedding=bias_embedding, vec_tensor=vec_tensor, vec_embedding=vec_embedding, feature_columns=self._feature_columns)
    spec = self._model_fn(model, features, labels, mode)
    assert model._frozen, 'Please finalize model in model_fn'
    return (spec, model)