Skip to content

Commit

Permalink
Replace tff.types.tensorflow_to_type with tff.tensorflow.to_type.
Browse files Browse the repository at this point in the history
This is a no-op change.

PiperOrigin-RevId: 679158905
  • Loading branch information
michaelreneer authored and copybara-github committed Sep 26, 2024
1 parent d665301 commit 92df35e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
"outputs": [],
"source": [
"tf_dataset_type = tff.SequenceType(\n",
" tff.types.tensorflow_to_type(tff_model.input_spec)\n",
" tff.tensorflow.to_type(tff_model.input_spec)\n",
")"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/composing_learning_algorithms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
" optimizer: tff.learning.optimizers.Optimizer,\n",
") -\u003e tff.learning.templates.ClientWorkProcess:\n",
" \"\"\"Creates a client work process that uses gradient clipping.\"\"\"\n",
" data_type = tff.SequenceType(tff.types.tensorflow_to_type(model.input_spec))\n",
" data_type = tff.SequenceType(tff.tensorflow.to_type(model.input_spec))\n",
" model_weights_type = tff.types.to_type(\n",
" tf.nest.map_structure(\n",
" lambda arr: tff.types.TensorType(shape=arr.shape, dtype=arr.dtype),\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/custom_federated_algorithms_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
"BATCH_SPEC = collections.OrderedDict(\n",
" x=tf.TensorSpec(shape=[None, 784], dtype=tf.float32),\n",
" y=tf.TensorSpec(shape=[None], dtype=tf.int32))\n",
"BATCH_TYPE = tff.types.tensorflow_to_type(BATCH_SPEC)\n",
"BATCH_TYPE = tff.tensorflow.to_type(BATCH_SPEC)\n",
"\n",
"str(BATCH_TYPE)"
]
Expand Down Expand Up @@ -447,7 +447,7 @@
"MODEL_SPEC = collections.OrderedDict(\n",
" weights=tf.TensorSpec(shape=[784, 10], dtype=tf.float32),\n",
" bias=tf.TensorSpec(shape=[10], dtype=tf.float32))\n",
"MODEL_TYPE = tff.types.tensorflow_to_type(MODEL_SPEC)\n",
"MODEL_TYPE = tff.tensorflow.to_type(MODEL_SPEC)\n",
"print(MODEL_TYPE)"
]
},
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_fedavg/simple_fedavg_tff.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def client_update_fn(server_message, tf_dataset):
# function, using tff.sequenece_reduce.

client_update_type_spec = client_update_fn.type_signature.result
batch_type = tff.types.tensorflow_to_type(model_fn().input_spec)
batch_type = tff.tensorflow.to_type(model_fn().input_spec)

@tff.tensorflow.computation(client_update_type_spec, batch_type)
def client_update_batch_fn(client_data, batch):
Expand Down Expand Up @@ -163,7 +163,7 @@ def server_message_fn(server_state):
return build_server_broadcast_message(server_state)

server_message_type = server_message_fn.type_signature.result
element_type = tff.types.tensorflow_to_type(whimsy_model.input_spec)
element_type = tff.tensorflow.to_type(whimsy_model.input_spec)
tf_dataset_type = tff.SequenceType(element_type)

federated_server_state_type = tff.FederatedType(server_state_type, tff.SERVER)
Expand Down
2 changes: 1 addition & 1 deletion examples/stateful_clients/stateful_fedavg_tff.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def server_message_fn(server_state):
return stateful_fedavg_tf.build_server_broadcast_message(server_state)

server_message_type = server_message_fn.type_signature.result
element_type = tff.types.tensorflow_to_type(whimsy_model.input_spec)
element_type = tff.tensorflow.to_type(whimsy_model.input_spec)
tf_dataset_type = tff.SequenceType(element_type)

@tff.tensorflow.computation(
Expand Down

0 comments on commit 92df35e

Please sign in to comment.