def _get_weights_manifest_for_group(group):
  """Gets the weights entries manifest JSON for a group.

  Args:
    group: A list of weight entries.
  Returns:
    An list of manifest entries (dicts) to be written in the weights manifest.
  """
  weights_entries = []
  for entry in group:
    is_quantized = 'quantization' in entry
    dtype = (entry['quantization']['original_dtype']
             if is_quantized else entry['data'].dtype.name)
    var_manifest = {
        'name': entry['name'],
        'shape': list(entry['data'].shape),
        'dtype': dtype
    }
    # String arrays have dtype 'object' and need extra metadata to parse.
    if dtype == 'object':
      var_manifest['dtype'] = 'string'
    if is_quantized:
      var_manifest['quantization'] = {
          'min': entry['quantization']['min'],
          'scale': entry['quantization']['scale'],
          'dtype': entry['data'].dtype.name
      }
    weights_entries.append(var_manifest)
  return weights_entries