Skip to content

Commit

Permalink
Remove deprecated ComputationBuildingBlock.proto method.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 731410182
  • Loading branch information
michaelreneer authored and copybara-github committed Feb 26, 2025
1 parent d21797d commit 624ceef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def optimize_tensorflow_comp(tf_computation, config_proto):
py_typecheck.check_type(
tf_computation, federated_language.framework.CompiledComputation
)
tf_proto = tf_computation.proto
tf_proto = tf_computation.to_proto()
graph_spec_obj = _unpack_proto_into_graph_spec(tf_proto)

optimized_graph_spec = graph_optimizations.optimize_graph_spec(
Expand Down Expand Up @@ -159,7 +159,7 @@ def transform(self, comp):
comp, federated_language.framework.CompiledComputation
)
new_comp_proto = tensorflow_computation_transformations.disable_grappler_for_partitioned_calls(
comp.proto
comp.to_proto()
)
return (
federated_language.framework.CompiledComputation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_constructs_tensor_zero(self):
self.assertTrue(
np.array_equal(
tensorflow_computation_test_utils.run_tensorflow(
tensor_zero.function.proto
tensor_zero.function.to_proto()
),
np.zeros([2, 2]),
)
Expand All @@ -56,7 +56,7 @@ def test_create_unnamed_tuple_zero(self):
self.assertEqual(tuple_zero.type_signature, tuple_type)
self.assertIsInstance(tuple_zero, federated_language.framework.Call)
result = tensorflow_computation_test_utils.run_tensorflow(
tuple_zero.function.proto
tuple_zero.function.to_proto()
)
self.assertLen(result, 2)
self.assertTrue(np.array_equal(result[0], np.zeros([2, 2])))
Expand All @@ -75,7 +75,7 @@ def test_create_named_tuple_one(self):
self.assertEqual(tuple_zero.type_signature, tuple_type)
self.assertIsInstance(tuple_zero, federated_language.framework.Call)
result = tensorflow_computation_test_utils.run_tensorflow(
tuple_zero.function.proto
tuple_zero.function.to_proto()
)
self.assertLen(result, 2)
self.assertTrue(np.array_equal(result.a, np.ones([2, 2])))
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_create_federated_tensor_one(self):
self.assertTrue(
np.array_equal(
tensorflow_computation_test_utils.run_tensorflow(
fed_zero.argument.function.proto
fed_zero.argument.function.to_proto()
),
np.ones([2, 2]),
)
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_create_federated_named_tuple_one(self):
)
self.assertIsInstance(fed_zero.argument, federated_language.framework.Call)
result = tensorflow_computation_test_utils.run_tensorflow(
fed_zero.argument.function.proto
fed_zero.argument.function.to_proto()
)
self.assertLen(result, 2)
self.assertTrue(np.array_equal(result.a, np.ones([2, 2])))
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_create_named_tuple_of_federated_tensors_zero(self):
)
self.assertIsInstance(fed_zero.argument, federated_language.framework.Call)
actual_result = tensorflow_computation_test_utils.run_tensorflow(
fed_zero.argument.function.proto
fed_zero.argument.function.to_proto()
)
self.assertTrue(np.array_equal(actual_result, np.zeros([2, 2])))

Expand Down

0 comments on commit 624ceef

Please sign in to comment.