message: One last data_set race condition fix.
diff: @@ -235,9 +235,6 @@ class ProcessInputOp : public OpKernel {
  string serialized_proto;
  OP_REQUIRES_OK(context, context->GetAttr("input_spec", &serialized_proto));
  input_spec_.ParseFromString(serialized_proto);
  -
  - data_set_ = std::unique_ptr<TensorDataSet>(
  - new TensorDataSet(input_spec_, random_seed_));
  }
  void Compute(OpKernelContext* context) override {
  @@ -249,7 +246,8 @@ class ProcessInputOp : public OpKernel {
  const Tensor& input_weights = context->input(7);
  const Tensor& leaf_ids_tensor = context->input(8);
  - data_set_->set_input_tensors(input_data, sparse_input_indices,
  + std::unique_ptr<TensorDataSet> data_set(new TensorDataSet(input_spec_, 0));
  + data_set->set_input_tensors(input_data, sparse_input_indices,
  sparse_input_values, sparse_input_shape);
  FertileStatsResource* fertile_stats_resource;
  @@ -264,7 +262,7 @@ class ProcessInputOp : public OpKernel {
  core::ScopedUnref unref_stats(fertile_stats_resource);
  core::ScopedUnref unref_tree(tree_resource);
  - const int32 num_data = data_set_->NumItems();
  + const int32 num_data = data_set->NumItems();
  auto worker_threads = context->device()->tensorflow_cpu_worker_threads();
  int num_threads = worker_threads->num_threads;
  @@ -308,23 +306,23 @@ class ProcessInputOp : public OpKernel {
  // from a digits run on local desktop. Heuristics might be necessary
  // if it really matters that much.
  const int64 costPerUpdate = 1000;
  - auto update = [this, &target, &leaf_ids_tensor, &num_targets,
  + auto update = [this, &target, &leaf_ids_tensor, &num_targets, &data_set,
  fertile_stats_resource, &locks, &set_lock, &ready_to_split,
  num_data](int64 start, int64 end) {
  CHECK(start <= end);
  CHECK(end <= num_data);
  - UpdateStats(fertile_stats_resource, data_set_, target, num_targets,
  + UpdateStats(fertile_stats_resource, data_set, target, num_targets,
  leaf_ids_tensor, &locks, &set_lock, static_cast<int32>(start),
  static_cast<int32>(end), &ready_to_split);
  };
  auto update_collated = [this, &target, &num_targets, fertile_stats_resource,
  tree_resource, &leaf_examples, &set_lock,
  - &ready_to_split,
  + &ready_to_split, &data_set,
  num_leaves](int64 start, int64 end) {
  CHECK(start <= end);
  CHECK(end <= num_leaves);
  - UpdateStatsCollated(fertile_stats_resource, tree_resource, data_set_,
  + UpdateStatsCollated(fertile_stats_resource, tree_resource, data_set,
  target, num_targets, leaf_examples, &set_lock,
  static_cast<int32>(start), static_cast<int32>(end),
  &ready_to_split);
  @@ -350,7 +348,6 @@ class ProcessInputOp : public OpKernel {
  private:
  int32 random_seed_;
  tensorforest::TensorForestDataSpec input_spec_;
  - std::unique_ptr<TensorDataSet> data_set_;
  TensorForestParams param_proto_;
  };
  