diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-08-23 16:35:14 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-08-23 17:54:30 -0700 |
commit | f6bc8cabbd3ac1fb3acc36d3edbdce672cae7d12 (patch) | |
tree | a8c81b0269e68f57606052ab5573743f86995be6 /tensorflow/core/framework/shape_inference_testutil.cc | |
parent | ade1672d60d861c58e1930e93a1b396b22e7a4d9 (diff) |
Add shape_inference::ShapeHandle and shape_inference::DimensionHandle to
replace uses of const Shape* and const Dimension*. This change only adds a
typedef and updates references. A later change will make DimensionHandle and
ShapeHandle real types instead of typedefs (to further hide the pointer
access).
Change: 131118981
Diffstat (limited to 'tensorflow/core/framework/shape_inference_testutil.cc')
-rw-r--r-- | tensorflow/core/framework/shape_inference_testutil.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tensorflow/core/framework/shape_inference_testutil.cc b/tensorflow/core/framework/shape_inference_testutil.cc index 60a9cb101f..28d2197629 100644 --- a/tensorflow/core/framework/shape_inference_testutil.cc +++ b/tensorflow/core/framework/shape_inference_testutil.cc @@ -25,8 +25,8 @@ limitations under the License. namespace tensorflow { -using shape_inference::Dimension; -using shape_inference::Shape; +using shape_inference::DimensionHandle; +using shape_inference::ShapeHandle; using errors::Unknown; Status InferShapes(ShapeInferenceTestOp op, const string& ins, @@ -48,9 +48,9 @@ Status InferShapes(ShapeInferenceTestOp op, const string& ins, TF_RETURN_IF_ERROR(op_reg_data->shape_inference_fn(&c)); const int num_outputs = c.num_outputs(); - std::unordered_map<const Dimension*, std::pair<int, int>> + std::unordered_map<DimensionHandle, std::pair<int, int>> dim_to_input_and_dim_idx; - std::unordered_map<const Shape*, int> shape_to_input_idx; + std::unordered_map<ShapeHandle, int> shape_to_input_idx; for (int i = 0; i < c.num_inputs(); ++i) { auto in = c.input(i); shape_to_input_idx[in] = i; @@ -120,7 +120,7 @@ Status InferShapes(ShapeInferenceTestOp op, const string& ins, for (int j = 0; j < expected_dims.size(); ++j) { err_prefix = strings::StrCat("Output dim ", i, ",", j); StringPiece expected_dim(expected_dims[j]); - const Dimension* out_dim = c.Dim(out, j); + DimensionHandle out_dim = c.Dim(out, j); std::pair<int, int> in_dim_idx = gtl::FindWithDefault( dim_to_input_and_dim_idx, out_dim, std::make_pair(-1, -1)); if (expected_dim == "?") { |