Fixes ValueErrors coming from simulations tutorial.
" limit = ids_per_client * (n + 1)\n",
" combined_dataset = None\n",
" while start \u003c limit:\n",
- " dataset = source.create_tf_dataset_for_client(source.client_ids[start]).map(\n",
- " lambda e: {\n",
- " 'x': tf.reshape(e['pixels'], [-1]),\n",
- " 'y': e['label'],\n",
- " })\n",
+ " client_id = source.client_ids[start]\n",
+ " mapper = lambda e: {'x': tf.reshape(e['pixels'], [-1]), 'y': e['label']}\n",
+ " dataset = source.create_tf_dataset_for_client(client_id).map(mapper)\n",
" start = start + 1\n",
" if combined_dataset is not None:\n",
" combined_dataset = combined_dataset.concatenate(dataset)\n",
