(mean_stdev)
return generator_utils.to_example(mean_stdev)
Converts the found mean and stdev to tfrecords example.
Converts the found mean and stdev to tfrecords example.
Converts the found mean and stdev to tfrecords example .
def _mean_to_example(mean_stdev):
  """Converts the found mean and stdev to tfrecords example."""
  # mean_stdev is a dict
  mean_stdev['mean'] = np.reshape(mean_stdev['mean'],
                                  [10]).astype(np.float32).tolist()
  mean_stdev['variance'] = np.reshape(mean_stdev['variance'],
                                      [10]).astype(np.float32).tolist()
  mean_stdev['stddev'] = np.reshape(mean_stdev['stddev'],
                                    [10]).astype(np.float32).tolist()
  mean_stdev['count'] = np.reshape(mean_stdev['count'],
                                   [1]).astype(np.int64).tolist()
  return generator_utils.to_example(mean_stdev)
def _mean_to_example ( mean_stdev ) : # mean_stdev is a dict mean_stdev [ 'mean' ] = np . reshape ( mean_stdev [ 'mean' ] , [ 10 ] ) . astype ( np . float32 ) . tolist ( ) mean_stdev [ 'variance' ] = np . reshape ( mean_stdev [ 'variance' ] , [ 10 ] ) . astype ( np . float32 ) . tolist ( ) mean_stdev [ 'stddev' ] = np . reshape ( mean_stdev [ 'stddev' ] , [ 10 ] ) . astype ( np . float32 ) . tolist ( ) mean_stdev [ 'count' ] = np . reshape ( mean_stdev [ 'count' ] , [ 1 ] ) . astype ( np . int64 ) . tolist ( ) return generator_utils . to_example ( mean_stdev )