(dataset, training)
return dataset
Pre-processing function that squeezes last axis of targets.
Pre-processing function that squeezes last axis of targets.
Pre - processing function that squeezes last axis of targets .
def squeeze_targets_preprocess(dataset, training):
  """Pre-processing function that squeezes last axis of targets."""
  del training

  def squeeze(features, targets):
    if targets.shape[-1] == 1:
      targets = tf.squeeze(targets, axis=-1)
    return features, targets

  dataset = dataset.map(squeeze)
  return dataset
def squeeze_targets_preprocess ( dataset , training ) : del training def squeeze ( features , targets ) : if targets . shape [ - 1 ] == 1 : targets = tf . squeeze ( targets , axis = - 1 ) return features , targets dataset = dataset . map ( squeeze ) return dataset