Skip to content

Commit

Permalink
Automated rollback of commit b17905e
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568247634
  • Loading branch information
michaelreneer authored and tensorflow-copybara committed Sep 25, 2023
1 parent 06585c3 commit c23b172
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1,633 deletions.
1 change: 0 additions & 1 deletion tensorflow_federated/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
from tensorflow_federated.python.core.impl.federated_context.value_impl import to_value
from tensorflow_federated.python.core.impl.federated_context.value_impl import Value
from tensorflow_federated.python.core.impl.jax_context.jax_computation import jax_computation
from tensorflow_federated.python.core.impl.tensorflow_context.tensorflow_computation import experimental_tf_fn_computation
from tensorflow_federated.python.core.impl.tensorflow_context.tensorflow_computation import tf_computation
from tensorflow_federated.python.core.impl.types.computation_types import at_clients as type_at_clients
from tensorflow_federated.python.core.impl.types.computation_types import at_server as type_at_server
Expand Down
21 changes: 0 additions & 21 deletions tensorflow_federated/cc/core/impl/executors/eager_computation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,27 +445,6 @@ absl::Status UpdateVariableLayouts(

} // namespace

absl::StatusOr<EagerComputation> EagerComputation::FromProto(
const v0::TensorFlowFunction& comp_pb,
std::map<std::string, tensorflow::dtensor::Layout> layout_map) {
if (!comp_pb.function_def().Is<tensorflow::FunctionDef>()) {
return absl::InvalidArgumentError(absl::StrCat(
"Unsupported type in function def proto: ",
comp_pb.function_def().type_url(), ". Only FunctionDef is supported."));
}
// If input is FunctionDef, directly register the functionDef for calling
// later from Call method.
tensorflow::FunctionDef func_def;
if (!comp_pb.function_def().UnpackTo(&func_def)) {
return absl::InternalError("Could not unpack FunctionDef proto");
}

TFF_TRY(UpdateVariableLayouts(func_def, layout_map));
UpdateVarHandleOpNodesAsAnonymous(func_def);
// Note: Nested function defs should be passed here for second argument.
return EagerComputation(func_def, {});
}

absl::StatusOr<EagerComputation> EagerComputation::FromProto(
const v0::TensorFlow& comp_pb,
std::map<std::string, tensorflow::dtensor::Layout> layout_map) {
Expand Down
15 changes: 0 additions & 15 deletions tensorflow_federated/cc/core/impl/executors/eager_computation.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,6 @@ class EagerComputation {
static absl::StatusOr<EagerComputation> FromProto(
const v0::TensorFlow& comp_pb,
std::map<std::string, tensorflow::dtensor::Layout> layout_map = {});
// Extracts FunctionDef defined in Computation->TensorFlowFunction and
// instantiates EagerComputation class.
// If non-empty Layout map is passed, a Relayout op is inserted after each
// VarHandleOp node which has sharding spec specified.
//
// The placeholder inputs are expected to be sharded by the caller.
// In DTensorExecutor, sharding for input bindings are applied before invoking
// EagerComputation->Call.
//
// Note that Layout Map should only be specified when running EagerComputation
// on a DTensor Mesh or with a DTensor device. "Relayout" op is only
// recognized by DTensor device.
static absl::StatusOr<EagerComputation> FromProto(
const v0::TensorFlowFunction& comp_pb,
std::map<std::string, tensorflow::dtensor::Layout> layout_map = {});

EagerComputation(
tensorflow::FunctionDef main_function_def,
Expand Down
Loading

0 comments on commit c23b172

Please sign in to comment.