text:
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def_builder.h"
#include "tensorflow/core/framework/shape_inference.h"

namespace tensorflow {

using shape_inference::DimensionHandle;
using shape_inference::InferenceContext;
using shape_inference::ShapeHandle;

namespace {

Status DequeueManyV2Shape(InferenceContext* c, ShapeHandle n_shape) {
  auto* t = c->input_handle_shapes_and_types(0);
  if (t != nullptr && t->size() == c->num_outputs()) {
    for (int i = 0; i < c->num_outputs(); ++i) {
      ShapeHandle combined_shape;
      TF_RETURN_IF_ERROR(
          c->Concatenate(n_shape, (*t)[i].shape, &combined_shape));
      c->set_output(i, combined_shape);
    }
    return Status::OK();
  } else {
    return shape_inference::UnknownShape(c);
  }
}

}  // namespace

// --------------------------------------------------------------------------

REGISTER_OP("DynamicPartition")
    .Input("data: T")
    .Input("partitions: int32")
    .Output("outputs: num_partitions * T")
    .Attr("num_partitions: int")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      int64 num_partitions;
      TF_RETURN_IF_ERROR(c->GetAttr("num_partitions", &num_partitions));

      ShapeHandle data_shape = c->input(0);
      ShapeHandle partitions_shape = c->input(1);

      if (!c->RankKnown(partitions_shape)) {
        return shape_inference::UnknownShape(c);
      }

      const int64 rank = c->Rank(partitions_shape);

      // data shape must start with partitions_shape
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(
          c->MergePrefix(data_shape, partitions_shape, &unused, &unused));

      // The partition shape is dynamic in the 0th dimension, and matches
      // data_shape in the remaining dimensions.
      ShapeHandle unknown_dim0 = c->MakeShape({c->UnknownDim()});

      ShapeHandle data_suffix_shape;
      TF_RETURN_IF_ERROR(c->Subshape(data_shape, rank, &data_suffix_shape));
      ShapeHandle result_shape;
      TF_RETURN_IF_ERROR(
          c->Concatenate(unknown_dim0, data_suffix_shape, &result_shape));

      for (int i = 0; i < c->num_outputs(); ++i) {
        c->set_output(i, result_shape);
      }

      return Status::OK();
    });

namespace {

Status DynamicStitchShapeFunction(InferenceContext* c) {
  int32 num_partitions;
  TF_RETURN_IF_ERROR(c->GetAttr("N", &num_partitions));

  bool all_indices_constant = true;
  int32 max_index = 0;
  ShapeHandle extra_shape = c->UnknownShape();
  for (int i = 0; i < num_partitions; ++i) {
    const Tensor* indices_t = c->input_tensor(i);
    if (indices_t == nullptr) {
      all_indices_constant = false;
    }

    ShapeHandle indices_shape = c->input(i);
    ShapeHandle data_shape = c->input(i + num_partitions);
    if (!c->RankKnown(indices_shape)) {
      continue;
    }
    const int64 indices_rank = c->Rank(indices_shape);

    // Assert that data_shape starts with indices_shape.
    ShapeHandle unused;
    TF_RETURN_IF_ERROR(
        c->MergePrefix(data_shape, indices_shape, &unused, &unused));

    // The rest belongs to output.
    ShapeHandle rest;
    TF_RETURN_IF_ERROR(c->Subshape(data_shape, indices_rank, &rest));
    TF_RETURN_IF_ERROR(c->Merge(extra_shape, rest, &extra_shape));

    if (indices_t != nullptr) {
      // The length is based on the highest index from flattened indices.
      const int32* indices = indices_t->flat<int32>().data();
      int64 count = indices_t->NumElements();
      for (int64 i = 0; i < count; ++i) {
        if (indices[i] > max_index) {
          max_index = indices[i];
        }
      }
    }
  }

  ShapeHandle output_shape = c->Vector(
      all_indices_constant ? c->MakeDim(max_index + 1) : c->UnknownDim());
  TF_RETURN_IF_ERROR(c->Concatenate(output_shape, extra_shape, &output_shape));
  c->set_output(0, output_shape);
  return Status::OK();
}

}  // namespace

REGISTER_OP("DynamicStitch")
    .Input("indices: N * int32")
    .Input("data: N * T")
    .Output("merged: T")
    .Attr("N : int >= 1")
    .Attr("T : type")
    .SetShapeFn(DynamicStitchShapeFunction);

REGISTER_OP("ParallelDynamicStitch")
    .Input("indices: N * int32")
    .Input("data: N * T")
    .Output("merged: T")
    .Attr("N : int >= 1")
    .Attr("T : type")
    .SetShapeFn(DynamicStitchShapeFunction);

// --------------------------------------------------------------------------

namespace {
Status TwoElementVectorInputsAndScalarOutputs(InferenceContext* c) {
  ShapeHandle handle;
  DimensionHandle unused_handle;
  for (int i = 0; i < c->num_inputs(); ++i) {
    TF_RETURN_IF_ERROR(c->WithRank(c->input(i), 1, &handle));
    TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_handle));
  }
  for (int i = 0; i < c->num_outputs(); ++i) {
    c->set_output(i, c->Scalar());
  }
  return Status::OK();
}

Status TwoElementOutput(InferenceContext* c) {
  c->set_output(0, c->Vector(2));
  return Status::OK();
}
}  // namespace

REGISTER_OP("RandomShuffleQueue")
    .Output("handle: Ref(string)")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("min_after_dequeue: int = 0")
    .Attr("seed: int = 0")
    .Attr("seed2: int = 0")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("RandomShuffleQueueV2")
    .Output("handle: resource")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("min_after_dequeue: int = 0")
    .Attr("seed: int = 0")
    .Attr("seed2: int = 0")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("FIFOQueue")
    .Output("handle: Ref(string)")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("FIFOQueueV2")
    .Output("handle: resource")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("PaddingFIFOQueue")
    .Output("handle: Ref(string)")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("PaddingFIFOQueueV2")
    .Output("handle: resource")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("PriorityQueue")
    .Output("handle: Ref(string)")
    .Attr("component_types: list(type) >= 0 = []")
    .Attr("shapes: list(shape) >= 0")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("PriorityQueueV2")
    .Output("handle: resource")
    .Attr("component_types: list(type) >= 0 = []")
    .Attr("shapes: list(shape) >= 0")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("FakeQueue")
    .Input("resource: resource")
    .Output("handle: Ref(string)")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("QueueEnqueue")
    .Input("handle: Ref(string)")
    .Input("components: Tcomponents")
    .Attr("Tcomponents: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueEnqueueV2")
    .Input("handle: resource")
    .Input("components: Tcomponents")
    .Attr("Tcomponents: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueEnqueueMany")
    .Input("handle: Ref(string)")
    .Input("components: Tcomponents")
    .Attr("Tcomponents: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueEnqueueManyV2")
    .Input("handle: resource")
    .Input("components: Tcomponents")
    .Attr("Tcomponents: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueDequeue")
    .Input("handle: Ref(string)")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueDequeueV2")
    .Input("handle: resource")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn([](InferenceContext* c) {
      auto* t = c->input_handle_shapes_and_types(0);
      if (t != nullptr && t->size() == c->num_outputs()) {
        for (int i = 0; i < c->num_outputs(); ++i) {
          c->set_output(i, (*t)[i].shape);
        }
        return Status::OK();
      } else {
        return shape_inference::UnknownShape(c);
      }
    });

REGISTER_OP("QueueDequeueMany")
    .Input("handle: Ref(string)")
    .Input("n: int32")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueDequeueManyV2")
    .Input("handle: resource")
    .Input("n: int32")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle n_shape;
      if (c->input_tensor(1) == nullptr) {
        n_shape = c->Vector(InferenceContext::kUnknownDim);
      } else {
        const int32 n = c->input_tensor(1)->scalar<int32>()();
        if (n < 0) {
          return errors::InvalidArgument("Input 'n' must be >= 0, but is ", n);
        }
        n_shape = c->Vector(n);
      }
      return DequeueManyV2Shape(c, n_shape);
    });

REGISTER_OP("QueueDequeueUpTo")
    .Input("handle: Ref(string)")
    .Input("n: int32")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("QueueDequeueUpToV2")
    .Input("handle: resource")
    .Input("n: int32")
    .Output("components: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn([](InferenceContext* c) {
      return DequeueManyV2Shape(c, c->Vector(InferenceContext::kUnknownDim));
    });

REGISTER_OP("QueueClose")
    .Input("handle: Ref(string)")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs)
    .Attr("cancel_pending_enqueues: bool = false");

REGISTER_OP("QueueCloseV2")
    .Input("handle: resource")
    .SetShapeFn(shape_inference::NoOutputs)
    .Attr("cancel_pending_enqueues: bool = false");

REGISTER_OP("QueueIsClosed")
    .Input("handle: Ref(string)")
    .Output("is_closed: bool")
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("QueueIsClosedV2")
    .Input("handle: resource")
    .Output("is_closed: bool")
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("QueueSize")
    .Input("handle: Ref(string)")
    .Output("size: int32")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs);

REGISTER_OP("QueueSizeV2")
    .Input("handle: resource")
    .Output("size: int32")
    .SetShapeFn(shape_inference::UnchangedShape);

// --------------------------------------------------------------------------

REGISTER_OP("AccumulatorNumAccumulated")
    .Input("handle: Ref(string)")
    .Output("num_accumulated: int32")
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("AccumulatorSetGlobalStep")
    .Input("handle: Ref(string)")
    .Input("new_global_step: int64")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      return Status::OK();
    });

REGISTER_OP("ConditionalAccumulator")
    .Output("handle: Ref(string)")
    .Attr("dtype: numbertype")
    .Attr("shape: shape")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .Attr("reduction_type: { 'MEAN', 'SUM' } = 'MEAN' ")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      c->set_output(0, c->Vector(2));
      return Status::OK();
    });

REGISTER_OP("AccumulatorApplyGradient")
    .Input("handle: Ref(string)")
    .Input("local_step: int64")
    .Input("gradient: dtype")
    .Attr("dtype: numbertype")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      return Status::OK();
    });

REGISTER_OP("AccumulatorTakeGradient")
    .Input("handle: Ref(string)")
    .Input("num_required: int32")
    .Output("average: dtype")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      // Shape of output is the shape of the accumulator referenced
      // by 'handle', but which is not available here, so we lose
      // shape information.
      return shape_inference::UnknownShape(c);
    })
    .Attr("dtype: numbertype");

REGISTER_OP("SparseConditionalAccumulator")
    .Output("handle: Ref(string)")
    .Attr("dtype: numbertype")
    .Attr("shape: shape")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .Attr("reduction_type: { 'MEAN', 'SUM' } = 'MEAN' ")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      c->set_output(0, c->Vector(2));
      return Status::OK();
    });

REGISTER_OP("SparseAccumulatorApplyGradient")
    .Input("handle: Ref(string)")
    .Input("local_step: int64")
    .Input("gradient_indices: int64")
    .Input("gradient_values: dtype")
    .Input("gradient_shape: int64")
    .Attr("dtype: numbertype")
    .Attr("has_known_shape: bool")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      return Status::OK();
    });

REGISTER_OP("SparseAccumulatorTakeGradient")
    .Input("handle: Ref(string)")
    .Input("num_required: int32")
    .Output("indices: int64")
    .Output("values: dtype")
    .Output("shape: int64")
    .Attr("dtype: numbertype")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      // Shape of output is the shape of the accumulator referenced
      // by 'handle', but which is not available here, so we lose
      // shape information.
      return shape_inference::UnknownShape(c);
    });

// --------------------------------------------------------------------------

REGISTER_OP("StackV2")
    .Input("max_size: int32")
    .Output("handle: resource")
    .Attr("elem_type: type")
    .Attr("stack_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("StackPushV2")
    .Input("handle: resource")
    .Input("elem: T")
    .Output("output: T")
    .Attr("T: type")
    .Attr("swap_memory: bool = false")
    .SetShapeFn([](shape_inference::InferenceContext* c) {
      c->set_output(0, c->input(1));
      return Status::OK();
    });

REGISTER_OP("StackPopV2")
    .Input("handle: resource")
    .Output("elem: elem_type")
    .Attr("elem_type: type")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("StackCloseV2")
    .Input("handle: resource")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs);

// Deprecated ref-typed variants of stack.

REGISTER_OP("Stack")
    .Output("handle: Ref(string)")
    .Attr("elem_type: type")
    .Attr("stack_name: string = ''")
    .SetIsStateful()
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("StackPush")
    .Input("handle: Ref(string)")
    .Input("elem: T")
    .Output("output: T")
    .Attr("T: type")
    .Attr("swap_memory: bool = false")
    .SetShapeFn([](shape_inference::InferenceContext* c) {
      c->set_output(0, c->input(1));
      return Status::OK();
    });

REGISTER_OP("StackPop")
    .Input("handle: Ref(string)")
    .Output("elem: elem_type")
    .Attr("elem_type: type")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("StackClose")
    .Input("handle: Ref(string)")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs);

// --------------------------------------------------------------------------

REGISTER_OP("TensorArrayV3")
    .Input("size: int32")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .Attr("dynamic_size: bool = false")
    .Attr("clear_after_read: bool = true")
    .Attr("identical_element_shapes: bool = false")
    .Attr("tensor_array_name: string = ''")
    .Output("handle: resource")
    .Output("flow: float")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 0, &unused));
      c->set_output(0, c->Vector(2));
      c->set_output(1, c->Scalar());
      bool identical_shapes;
      TF_RETURN_IF_ERROR(
          c->GetAttr("identical_element_shapes", &identical_shapes));
      DataType t;
      TF_RETURN_IF_ERROR(c->GetAttr("dtype", &t));
      PartialTensorShape p;
      TF_RETURN_IF_ERROR(c->GetAttr("element_shape", &p));
      ShapeHandle s;
      TF_RETURN_IF_ERROR(c->MakeShapeFromPartialTensorShape(p, &s));
      if (c->FullyDefined(s) || identical_shapes) {
        c->set_output_handle_shapes_and_types(
            0, std::vector<shape_inference::ShapeAndType>{{s, t}});
      }
      return Status::OK();
    });

REGISTER_OP("TensorArrayGradV3")
    .Input("handle: resource")
    .Input("flow_in: float")
    .Output("grad_handle: resource")
    .Output("flow_out: float")
    .Attr("source: string")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      c->set_output(0, c->Vector(2));
      c->set_output(1, c->Scalar());
      if (c->input_handle_shapes_and_types(0)) {
        c->set_output_handle_shapes_and_types(
            0, *c->input_handle_shapes_and_types(0));
      }
      return Status::OK();
    });

REGISTER_OP("TensorArrayGradWithShape")
    .Input("handle: resource")
    .Input("flow_in: float")
    .Input("shape_to_prepend: int32")
    .Output("grad_handle: resource")
    .Output("flow_out: float")
    .Attr("source: string")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      c->set_output(0, c->Vector(2));
      c->set_output(1, c->Scalar());
      auto* shape_and_type = c->input_handle_shapes_and_types(0);
      if (shape_and_type) {
        auto input_shape = (*shape_and_type)[0].shape;
        auto dtype = (*shape_and_type)[0].dtype;
        // Note that shape_to_preped is a rank 1 Tensor representing a shape.
        // The size of dimension 0 is the number of dimensions we need to add to
        // output shape.
        int64 prepend_rank = c->Value(c->Dim(c->input(2), 0));
        if (c->RankKnown(input_shape) &&
            prepend_rank != InferenceContext::kUnknownDim) {
          int32 input_rank = c->Rank(input_shape);
          std::vector<DimensionHandle> dims;
          dims.reserve(prepend_rank + input_rank);
          for (int i = 0; i < prepend_rank; ++i) {
            dims.push_back(c->UnknownDim());
          }
          for (int i = 0; i < input_rank; ++i) {
            dims.push_back(c->Dim(input_shape, i));
          }
          c->set_output_handle_shapes_and_types(0,
                                                {{c->MakeShape(dims), dtype}});
        } else {
          c->set_output_handle_shapes_and_types(0,
                                                {{c->UnknownShape(), dtype}});
        }
      }
      return Status::OK();
    });

REGISTER_OP("TensorArrayWriteV3")
    .Input("handle: resource")
    .Input("index: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));

      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));

      auto* handle_data = c->input_handle_shapes_and_types(0);
      if (handle_data != nullptr && !handle_data->empty()) {
        shape_inference::ShapeAndType shape_and_type = (*handle_data)[0];
        ShapeHandle value_shape = c->input(2);
        TF_RETURN_IF_ERROR(
            c->Merge(shape_and_type.shape, value_shape, &unused));
      }

      return shape_inference::ScalarShape(c);
    });

REGISTER_OP("TensorArrayReadV3")
    .Input("handle: resource")
    .Input("index: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &unused));
      auto shapes = c->input_handle_shapes_and_types(0);
      if (shapes != nullptr && !shapes->empty()) {
        ShapeHandle tensor_shape = shapes->at(0).shape;
        c->set_output(0, tensor_shape);
        return Status::OK();
      } else {
        return shape_inference::UnknownShape(c);
      }
    });

REGISTER_OP("TensorArrayGatherV3")
    .Input("handle: resource")
    .Input("indices: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle indices;
      ShapeHandle unused;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &indices));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(c->input(0), 0), 2, &unused_dim));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &unused));
      auto shapes = c->input_handle_shapes_and_types(0);
      if (shapes != nullptr && !shapes->empty()) {
        ShapeHandle tensor_shape = shapes->at(0).shape;
        ShapeHandle output_shape;
        TF_RETURN_IF_ERROR(
            c->Concatenate(indices, tensor_shape, &output_shape));
        c->set_output(0, output_shape);
        return Status::OK();
      } else {
        PartialTensorShape p;
        TF_RETURN_IF_ERROR(c->GetAttr("element_shape", &p));
        ShapeHandle s;
        TF_RETURN_IF_ERROR(c->MakeShapeFromPartialTensorShape(p, &s));
        ShapeHandle output_shape;
        TF_RETURN_IF_ERROR(c->Concatenate(indices, s, &output_shape));
        c->set_output(0, output_shape);
        return Status::OK();
      }
    });

REGISTER_OP("TensorArrayScatterV3")
    .Input("handle: resource")
    .Input("indices: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle indices;
      ShapeHandle unused;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &indices));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(c->input(0), 0), 2, &unused_dim));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
      ShapeHandle value_shape;
      // Assert that the length of the indices tensor is equal to the first
      // dimension of the value tensor.
      TF_RETURN_IF_ERROR(
          c->MergePrefix(c->input(2), indices, &value_shape, &indices));
      auto shapes = c->input_handle_shapes_and_types(0);
      if (shapes != nullptr && !shapes->empty()) {
        ShapeHandle tensor_shape = shapes->at(0).shape;
        ShapeHandle fed_shape;
        TF_RETURN_IF_ERROR(c->Subshape(value_shape, 1, &fed_shape));
        TF_RETURN_IF_ERROR(c->Merge(tensor_shape, fed_shape, &fed_shape));
      }
      return shape_inference::ScalarShape(c);
    });

REGISTER_OP("TensorArrayConcatV3")
    .Input("handle: resource")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Output("lengths: int64")
    .Attr("dtype: type")
    .Attr("element_shape_except0: shape = { unknown_rank: true }")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      c->set_output(0, c->UnknownShape());
      c->set_output(1, c->Vector(c->UnknownDim()));
      return Status::OK();
    });

REGISTER_OP("TensorArraySplitV3")
    .Input("handle: resource")
    .Input("value: T")
    .Input("lengths: int64")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
      return shape_inference::ScalarShape(c);
    });

REGISTER_OP("TensorArraySizeV3")
    .Input("handle: resource")
    .Input("flow_in: float")
    .Output("size: int32")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      return shape_inference::ScalarShape(c);
    });

REGISTER_OP("TensorArrayCloseV3")
    .Input("handle: resource")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      return Status::OK();
    });

// --------------------------------------------------------------------------

// Deprecated TensorArray methods

REGISTER_OP("TensorArray")
    .Input("size: int32")
    .Attr("dtype: type")
    .Attr("dynamic_size: bool = false")
    .Attr("clear_after_read: bool = true")
    .Attr("tensor_array_name: string = ''")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .Output("handle: Ref(string)")
    .SetIsStateful()
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayV3");
REGISTER_OP("TensorArrayV2")
    .Input("size: int32")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .Attr("dynamic_size: bool = false")
    .Attr("clear_after_read: bool = true")
    .Attr("tensor_array_name: string = ''")
    .Output("handle: string")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 0, &unused));
      c->set_output(0, c->Vector(2));
      return Status::OK();
    })
    .Deprecated(26, "Use TensorArrayV3");
REGISTER_OP("TensorArrayGrad")
    .Input("handle: string")
    .Input("flow_in: float")
    .Output("grad_handle: Ref(string)")
    .Attr("source: string")
    .SetIsStateful()
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayGradV3");
REGISTER_OP("TensorArrayGradV2")
    .Input("handle: string")
    .Input("flow_in: float")
    .Output("grad_handle: string")
    .Attr("source: string")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      c->set_output(0, c->Vector(2));
      return Status::OK();
    })
    .Deprecated(26, "Use TensorArrayGradV3");
REGISTER_OP("TensorArrayWrite")
    .Input("handle: Ref(string)")
    .Input("index: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayWriteV3");
REGISTER_OP("TensorArrayWriteV2")
    .Input("handle: string")
    .Input("index: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));

      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
      return shape_inference::ScalarShape(c);
    })
    .Deprecated(26, "Use TensorArrayWriteV3");
REGISTER_OP("TensorArrayRead")
    .Input("handle: Ref(string)")
    .Input("index: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayReadV3");
REGISTER_OP("TensorArrayReadV2")
    .Input("handle: string")
    .Input("index: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &unused));
      return shape_inference::UnknownShape(c);
    })
    .Deprecated(26, "Use TensorArrayReadV3");
REGISTER_OP("TensorArrayPack")
    .Input("handle: Ref(string)")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayGatherV3 with RangeOp");
REGISTER_OP("TensorArrayUnpack")
    .Input("handle: Ref(string)")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(20, "Use TensorArrayScatterV3 with RangeOp");
REGISTER_OP("TensorArrayGather")
    .Input("handle: Ref(string)")
    .Input("indices: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayGatherV3");
REGISTER_OP("TensorArrayGatherV2")
    .Input("handle: string")
    .Input("indices: int32")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Attr("dtype: type")
    .Attr("element_shape: shape = { unknown_rank: true }")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(c->input(0), 0), 2, &unused_dim));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 0, &unused));
      return shape_inference::UnknownShape(c);
    })
    .Deprecated(26, "Use TensorArrayGatherV3");
REGISTER_OP("TensorArrayScatter")
    .Input("handle: Ref(string)")
    .Input("indices: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(19, "Use TensorArrayGradV3");
REGISTER_OP("TensorArrayScatterV2")
    .Input("handle: string")
    .Input("indices: int32")
    .Input("value: T")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(c->input(0), 0), 2, &unused_dim));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
      return shape_inference::ScalarShape(c);
    })
    .Deprecated(26, "Use TensorArrayScatterV3");
REGISTER_OP("TensorArrayConcat")
    .Input("handle: Ref(string)")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Output("lengths: int64")
    .Attr("dtype: type")
    .Attr("element_shape_except0: shape = { unknown_rank: true }")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArrayGradV3");
REGISTER_OP("TensorArrayConcatV2")
    .Input("handle: string")
    .Input("flow_in: float")
    .Output("value: dtype")
    .Output("lengths: int64")
    .Attr("dtype: type")
    .Attr("element_shape_except0: shape = { unknown_rank: true }")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(1), 0, &unused));
      c->set_output(0, c->UnknownShape());
      c->set_output(1, c->Vector(c->UnknownDim()));
      return Status::OK();
    });
REGISTER_OP("TensorArraySplit")
    .Input("handle: Ref(string)")
    .Input("value: T")
    .Input("lengths: int64")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArraySplitV3");
REGISTER_OP("TensorArraySplitV2")
    .Input("handle: string")
    .Input("value: T")
    .Input("lengths: int64")
    .Input("flow_in: float")
    .Output("flow_out: float")
    .Attr("T: type")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(2), 1, &unused));
      TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused));
      return shape_inference::ScalarShape(c);
    })
    .Deprecated(26, "Use TensorArraySplitV3");
REGISTER_OP("TensorArraySize")
    .Input("handle: Ref(string)")
    .Input("flow_in: float")
    .Output("size: int32")
    .SetShapeFn(shape_inference::UnknownShape)
    .Deprecated(16, "Use TensorArraySizeV3");
REGISTER_OP("TensorArraySizeV2")
    .Input("handle: string")
    .Input("flow_in: float")
    .Output("size: int32")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      return shape_inference::ScalarShape(c);
    })
    .Deprecated(26, "Use TensorArraySizeV3");
REGISTER_OP("TensorArrayClose")
    .Input("handle: Ref(string)")
    .SetShapeFn([](InferenceContext* c) { return Status::OK(); })
    .Deprecated(16, "Use TensorArrayCloseV3");
REGISTER_OP("TensorArrayCloseV2")
    .Input("handle: string")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle handle;
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      return Status::OK();
    })
    .Deprecated(26, "Use TensorArrayCloseV3");

// --------------------------------------------------------------------------

REGISTER_OP("Barrier")
    .SetIsStateful()
    .Output("handle: Ref(string)")
    .Attr("component_types: list(type) >= 1")
    .Attr("shapes: list(shape) >= 0 = []")
    .Attr("capacity: int = -1")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(TwoElementOutput);

REGISTER_OP("BarrierInsertMany")
    .Input("handle: Ref(string)")
    .Input("keys: string")
    .Input("values: T")
    .Attr("T: type")
    .Attr("component_index: int")
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle keys = c->input(1);
      ShapeHandle values = c->input(2);
      ShapeHandle handle;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 1, &handle));
      DimensionHandle unused_dim;
      TF_RETURN_IF_ERROR(c->WithValue(c->Dim(handle, 0), 2, &unused_dim));
      TF_RETURN_IF_ERROR(c->WithRank(keys, 1, &keys));
      TF_RETURN_IF_ERROR(c->WithRankAtLeast(values, 1, &values));
      TF_RETURN_IF_ERROR(c->Merge(keys, c->Vector(c->Dim(values, 0)), &handle));
      return Status::OK();
    });

REGISTER_OP("BarrierTakeMany")
    .Input("handle: Ref(string)")
    .Input("num_elements: int32")
    .Output("indices: int64")
    .Output("keys: string")
    .Output("values: component_types")
    .Attr("component_types: list(type) >= 1")
    .Attr("allow_small_batch: bool = false")
    .Attr("wait_for_incomplete: bool = false")
    .Attr("timeout_ms: int = -1")
    .SetShapeFn(shape_inference::UnknownShape);

REGISTER_OP("BarrierClose")
    .Input("handle: Ref(string)")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs)
    .Attr("cancel_pending_enqueues: bool = false");

REGISTER_OP("BarrierReadySize")
    .Input("handle: Ref(string)")
    .Output("size: int32")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs);

REGISTER_OP("BarrierIncompleteSize")
    .Input("handle: Ref(string)")
    .Output("size: int32")
    .SetShapeFn(TwoElementVectorInputsAndScalarOutputs);

// --------------------------------------------------------------------------

REGISTER_OP("GetSessionHandle")
    .Input("value: T")
    .Output("handle: string")
    .Attr("T: type")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("GetSessionHandleV2")
    .Input("value: T")
    .Output("handle: resource")
    .Attr("T: type")
    .SetIsStateful()
    .SetShapeFn(shape_inference::ScalarShape);

REGISTER_OP("GetSessionTensor")
    .Input("handle: string")
    .Output("value: dtype")
    .Attr("dtype: type")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 0, &unused));
      return shape_inference::UnknownShape(c);
    });

REGISTER_OP("DeleteSessionTensor")
    .Input("handle: string")
    .SetIsStateful()
    .SetShapeFn([](InferenceContext* c) {
      ShapeHandle unused;
      TF_RETURN_IF_ERROR(c->WithRank(c->input(0), 0, &unused));
      return Status::OK();
    });

REGISTER_OP("Stage")
    .Input("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("Unstage")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("StagePeek")
    .Input("index: int32")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("StageSize")
    .Output("size: int32")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(shape_inference::ScalarShape)
    .SetIsStateful();

REGISTER_OP("StageClear")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(shape_inference::UnknownShape)
    .SetIsStateful();

// UnorderedMap
REGISTER_OP("MapStage")
    .Input("key: int64")
    .Input("indices: int32")
    .Input("values: fake_dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("fake_dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::NoOutputs)
    .SetIsStateful();

REGISTER_OP("MapPeek")
    .Input("key: int64")
    .Input("indices: int32")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("MapUnstage")
    .Input("key: int64")
    .Input("indices: int32")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("MapUnstageNoKey")
    .Input("indices: int32")
    .Output("key: int64")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("MapSize")
    .Output("size: int32")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::ScalarShape)
    .SetIsStateful();

REGISTER_OP("MapIncompleteSize")
    .Output("size: int32")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::ScalarShape)
    .SetIsStateful();

REGISTER_OP("MapClear")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::NoOutputs)
    .SetIsStateful();

// OrderedMap
REGISTER_OP("OrderedMapStage")
    .Input("key: int64")
    .Input("indices: int32")
    .Input("values: fake_dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("fake_dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::NoOutputs)
    .SetIsStateful();

REGISTER_OP("OrderedMapPeek")
    .Input("key: int64")
    .Input("indices: int32")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("OrderedMapUnstage")
    .Input("key: int64")
    .Input("indices: int32")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("OrderedMapUnstageNoKey")
    .Input("indices: int32")
    .Output("key: int64")
    .Output("values: dtypes")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::UnknownShape)
    .SetIsStateful();

REGISTER_OP("OrderedMapSize")
    .Output("size: int32")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::ScalarShape)
    .SetIsStateful();

REGISTER_OP("OrderedMapIncompleteSize")
    .Output("size: int32")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::ScalarShape)
    .SetIsStateful();

REGISTER_OP("OrderedMapClear")
    .Attr("capacity: int >= 0 = 0")
    .Attr("memory_limit: int >= 0 = 0")
    .Attr("dtypes: list(type)")
    .Attr("container: string = ''")
    .Attr("shared_name: string = ''")
    .SetShapeFn(tensorflow::shape_inference::NoOutputs)
    .SetIsStateful();

REGISTER_OP("RecordInput")
    .Output("records: string")
    .Attr("file_pattern: string")
    .Attr("file_random_seed: int = 301")
    .Attr("file_shuffle_shift_ratio: float = 0")
    .Attr("file_buffer_size: int = 10000")
    .Attr("file_parallelism: int = 16")
    .Attr("batch_size: int = 32")
    .Attr("compression_type: string = ''")
    .SetIsStateful()
    .SetShapeFn(shape_inference::UnknownShape);

}  // namespace tensorflow

redpajama_set_name: RedPajamaGithub


This year, the crawl will take place on Tuesday 20th September, leaving Lerryn car park at 10.15am. As usual, painstaking research has gone into investigating three or four worthy churches and even more painstaking research has been devoted to investigating a suitable hostelry for lunch! The most expert driver for the Lerryn minibus has also promised his services.
Apart from widening our knowledge, the object of the expedition is to raise money for the Cornwall Historic Churches Trust which has assisted all churches in our benefice (except Bradoc). It has become even more important, as it is the intermediary with the National Churches Trust and with Heritage.
If you wish to join the Church Crawl, you should contact Elizabeth St John or Andrew Foot. The minibus has of course limited capacity but some usually follow in their cars.


Long poly dA.dT tracts are enriched within the intergenic sequences of eukaryotic genomes where they appear to act as intrinsic regulators of nucleosome positioning. Previous studies of the incomplete genome of the human malarial parasite Plasmodium falciparum, reported a high enrichment of long poly dA.dT tracts, far above that expected for this AT rich genome (Zhou, et.al. 2004, Dechering, et.al. 1998). We report an analysis of the relative frequency, length and spatial arrangement of homopolymer tracts for the complete P. falciparum genome, extending this analysis to 12 additional Apicomplexan parasite genomes (Russell, et.al., 2014). Using nucleosome positioning data available for P. falciparum, we explore the correlation of poly dA.dT tracts with nucleosome positioning over key expression landmarks within intergenic regions. We describe three lineage-specific patterns of homopolymeric tract intergenic organization within these Apicomplexan parasites. Moreover, a striking enrichment pattern of long poly dA.dT tracts apparent in the intergenic regions of Plasmodium spp. uniquely extends into protein coding sequences. Also observed was a conserved spatial arrangement of elevated poly dA.dT frequencies immediately flanking translational start and stop sites (solid colored lines, Fig 1.) and over predicted core promoter sites (not shown). These three expression landmarks are all relatively depleted in nucleosomes (dashed line, Fig 1 panels) in P. falciparum (Ponts et.al. 2011) as would be expected for long poly dA.dT tracts acting as nucleosome exclusion sequences.
Fig. 1. Spatial distribution of nucleosome occupancy and poly dA.dT tracts over translational start and stop sites of P. falciparum ORF. Spatial distribution of observed tract frequencies (Fobs, right Y-axis) of N=5 (10 base bins) length dA (red line) and dT (blue line) over 400bp centered over translational start (A) and stop (B) sites. Experimental nucleosome occupancy (dashed line) presented as a log2 ratio of FAIRE to MAINE sequence reads (left Y-axis) increase in ratio indicates regions relatively deficient in nucleosomes.
N. Ponts et al. (2011) Infection Genetics and Evolution 11:716-724.
3Department of Biol. & Neurosci.


论文详细信息:Yuan D.X.*, Shen S.Z., Henderson C.M., Chen J., Zhang H., Zheng Q.F., Wu H.C., 2019. Integrative timescale for the Lopingian (Late Permian): A review and update from Shangsi, South China. Earth-Science Reviews, 188: 190-209. DOI: https://doi.org/10.1016/j.earscirev.2018.11.002.


Are you looking for something jaw doping this year? I hope you like turning heads because that is what our stunning floral corsages, boutonnieres, floral sleeves, Arm Corsage, & Floral Head Pieces will do! Click here to view a photo gallery of our wearable fashion.
Call or Text to (952) 479-0462.
Currently we are adding products to our wearable flower catalog. Do you have something in mind? We can create all types colors, styles, and sizes just for you! Call/Text (952) 479-0462 or contact us.
Below you find our selection of wrist & arm corsages. Are you looking for something unique? Give us a call (952) 479-0462, our expert designers can create a custom corsage just for you!
We are currently adding boutonnieres to this section. If you are looking for something special or unique, give us a call (952) 479-0462, our expert designers can create a custom corsage just for you.
We are currently adding head pieces and flower crowns. If you are looking for something special or unique, give us a call (952) 479-0462, our expert designers can create a custom corsage just for you.
Prom Corsages and boutonnieres, made from fresh flowers, ensure that you and your special someone look your absolute best at a formal occasion – wedding, prom, or homecoming dance. We pay attention to detail and listen to your ideas. Pick up your prom corsage or boutonniere from our floral studio or we can deliver.
It is customary for the guys to buy a prom corsage for his date and the girls to buy the boutonnieres. Frequently, both the corsage and boutonniere are ordered at the same time. Doing so helps ensure that the flowers match and says, "we are a couple." Depending on the style of the prom dress your date is wearing, Rebel Girl Floral has the perfect pin-on or wrist corsage. Before you place your order, be sure to know what color her dress (and your tuxedo) will be. This helps ensure that the flowers will not clash with what you are wearing. For tips on choosing a prom corsage or boutonniere, contact us.
Let Rebel Girl Floral deliver – it's one less thing to worry about on prom night. You will make her feel like the belle of the ball when you pull up to her door in a limo, with a fresh flower corsage and boutonniere set in hand. Orchid corsages and rose boutonnieres are the perfect floral accents to complete your formal look. Flowers like roses, ranunculus and miniature callas are favorites for prom boutonnieres. For the corsage, why not choose her favorite flower? Gerber and orchid corsages are surprisingly hardy, so even after a long night of dancing, they'll still look great in your prom photos. Rebel Girl Floral has the great selection of corsages and boutonnieres that are budget friendly for a high-schooler. Prom night is a rite of passage and probably the biggest event of your young life, make it memorable.


text:
Brandon Michael Vera (ur. 10 października 1977 w Norfolk) – amerykański zawodnik mieszanych sztuk walki (MMA), grappler oraz kick-boxer filipińskiego pochodzenia, zwycięzca turnieju WEC wagi ciężkiej z 2005 oraz mistrz świata ONE Championship z 2015 w wadze ciężkiej, zawodnik Ultimate Fighting Championship (UFC) w latach 2005–2013. Posiadacz czarnego pasa w brazylijskim jiu-jitsu.

Wczesne życie
Brandon Vera dorastał w domu, w którym było siedmiu chłopców i trzy dziewczynki. Urodził się z filipińskiego ojca, Ernesto, i włoskiej matki, ale wychowywany był przez filipińską macochę, Amelię. Poza rodziną, w której się wychował, ma jeszcze dwóch braci i siostrę, którzy okazjonalnie uczestniczyli w jego życiu. Wychował w Norfolk, Virginia i uczęszczał do Lake Taylor High School, gdzie wyróżniał się w zapasach i zdobył czteroletnie stypendium sportowe na Old Dominion University. Porzucił jednak uczelnię po półtora roku, gdy poczuł, że studia nie są dla niego. Zaciągnął się do Sił Powietrznych Stanów Zjednoczonych, gdzie dołączył do drużyny zapaśniczej i trenował w United States Olympic Training Center w Colorado Springs. Jego wojskowa kariera zapaśnicza została przerwana w 1999 roku, kiedy to zerwał więzadła w prawym łokciu. Operacja artroskopowa naprawiła więzadła, ale w wyniku tego doświadczenia doszło do uszkodzenia nerwów, co uniemożliwiło mu posługiwanie się prawą ręką. Został zwolniony z Sił Powietrznych na podstawie zwolnienia lekarskiego.

Po tym wrócił do Wirginii, gdzie systematycznie rehabilitował swoje ramię i w końcu był na tyle sprawny, aby wziąć udział w zawodach grapplerskich i  submission wrestlingu na wschodnim wybrzeżu. Tam, jego samotne metody treningowe zwrócił uwagę Lloyd Irvin, posiadacz czarnego pasa i tytułu trenera brazylijskiego jiu-jitsu, który zaprosił go do trenowania w swoim klubie. Tam też rozpoczął treningi mieszanych sztuk walki.

Kariera MMA
W MMA zadebiutował 6 lipca 2002 pokonując Adama Rivera. 22 stycznia 2005 wygrał turniej World Extreme Cagefighting wagi ciężkiej pokonując jednego wieczoru Andre Mussiego oraz Mike'a Whiteheada. 3 października 2005 zadebiutował w Ultimate Fighting Championship (UFC) nokautując Fabiano Schernera. Po trzech kolejnych zwycięstwach (m.in. nad Frankiem Mirem) które kończył przed czasem, na UFC 77 przegrał swoją pierwszą zawodową walkę z Timem Sylvią. 7 czerwca 2008 przegrał drugi pojedynek z rzędu, z Brazylijczykiem Fabricio Werdumem.

29 sierpnia 2009 na UFC 102 pokonał na punkty pochodzącego z Polski Krzysztofa Soszyńskiego. W 2008 zszedł do wagi półciężkiej (-93 kg). W latach 2009-2011 przegrał trzy pojedynki z rzędu: z wielokrotnym mistrzem UFC Randym Couturem, Jon Jonesem oraz Thiago Silvą, co skutkowało rozwiązaniem kontraktu. Niecały miesiąc po ostatniej walce, komisja sportowa stanu Nevada zawiesiła Brazylijczyka z powodu podmienienia próbki moczu na syntetyczną substancję. Silva został ukarany rokiem zawieszenia, karą finansową oraz zmianą statusu walki ze zwycięstwa na no-contest. W związku ze zmianą werdyktu kontrakt Very został przywrócony. W kolejnych latach uzyskał bilans 1-2. Po przegranej z Benem Rothwellem 31 sierpnia 2013 został ponownie zwolniony z organizacji.

5 grudnia 2014 zadebiutował w największej azjatyckiej organizacji ONE Championship nokautując Igora Subore. Rok później 11 grudnia 2015 został mistrzem tejże organizacji w wadze ciężkiej nokautując Paula Chenga w 26 sekundzie pojedynku.

Osiągnięcia

Mieszane sztuki walki
 2005: WEC Heavyweight Grand Prix – 1. miejsce w turnieju wagi ciężkiej
 2015: mistrz ONE Championship w wadze ciężkiej

Kick-boxing
 2002: WKA USA Nationals & Team Trials – 1. miejsce w kat. +91 kg

Grappling
 Grappler's Quest – ośmiokrotny zwycięzca turnieju brazylijskiego jiu-jitsu
 2003: Mistrzostwa Panamerykańskie IBJJF w Jiu-jitsu – 1. miejsce w kat. superciężkiej, niebieskie pasy
 2004: Mistrzostwa Panamerykańskie IBJJF w Jiu-jitsu – 1. miejsce w kat. superciężkiej, purpurowe pasy
 2006: Mistrzostwa Panamerykańskie IBJJF w Jiu-jitsu – 2. miejsce w kat. superciężkiej, brązowe pasy

Przypisy

Linki zewnętrzne
 Oficjalny rekord i statystyki MMA

Amerykańscy zawodnicy MMA
Amerykańscy kickbokserzy
Filipińscy sportowcy
Urodzeni w 1977
Ludzie urodzeni w Norfolk (Wirginia)

redpajama_set_name: RedPajamaWikipedia


Home › Internet Help › Do I need an active phone line to get Cable internet services?
No. You do not need an active telephone line to get Cable internet service.
‹ Where can I get alternative access codes for my Dialup connection?


I love seeing brands successfully innovate on such seemingly simple products like socks, that haven't really progressed much over the years. Tabio have created something really special with these Trailblazer trail running socks. Read on as I share 5 reasons why I love them so much. One reason for each toe!
If you haven't tried toe socks before then you must! They feel funny at first but once you've been running in them for 15 minutes or so, you'll be used to the alien feeling you first felt.
One of the many great things about toe socks is that having material encapsulating each toe allows the material to wick sweat away from your skin much more efficiently. Without the toe material, your toes warm each other up and end up sweating like 5 little piggies in a Turkish sauna. This sweating combined with toes that can rub against each other skin to skin, can lead to blisters forming. There's a downside to toe socks though; they take a little longer to put on. But if you're going to be using your precious feet for running a lot, shouldn't you give them that extra bit of love to keep them healthy? Yes, the answer is YES.
I realize that I'm starting to overuse the word 'toe', so I'm going to move on to my next reason now. Toe toe toey toe toe!
These socks have two layers of material. You guessed it, an inner and an outer.
The inner layer consists of Merino wool, renowned for its sweat wicking ability as well as the benefit of keeping you cool in warm weather and warm in cool weather. Yes it sounds a bit like magic, but in my experience with wearing Merino wool, its true!
And the outer layer is made from long lasting polyester and nylon fabrics, for their durability.
These socks look nice too, that's down to good design and quality materials used to make them. You can tell these socks are well made when you pick them up and even more so when you put them on and notice how soft they feel.
There's some clever stuff going on too with Tabio's patented arch support, ankle support, toe protection and heel stabilization. All these areas can be seen clearly as Tabio are using the orange coloured material for them.
Tabio have also added a silicon material to the sole of these socks which gives amazing grip. No more slipping over on the kitchen floor, and more importantly no more slipping inside your running shoes when its cold out and your feet take up less space than usual. I can't believe I haven't seen anyone else add this feature to running socks before! No slip means no rubbing, which means less chance of blisters. You almost feel like leaving your shoes at home as you've already got your grip sorted.
It's often the little things that count, and Tabio have added a lot of 'little things' to make these socks special. My favourite though has to be how the silicon grip spells "TRAIL" on the toes.
If you have any questions about these socks or anything relating to them then please leave a comment below and I will reply as soon as possible. Happy Trails!!


This compact handheld electronic calculator has a brown plastic case, a metal keyboard and display trim, and twenty-five rectangular plastic keys. In addition to ten digit keys, a decimal point key, four arithmetic function keys, a change sign key, a total key, a clear entry/clear key, an off key, and four memory keys, it has a square root key and a % key. Text above the keyboard reads: NSC National Semiconductor 99. Behind this are three brightly colored circles. Behind this is an eight-digit LCD display.
The back of the calculator has a compartment for two small batteries. A sticker next to it reads: NSC National Semiconductor (/) WEST JORDAN, (/) UTAH 84084 (/) MODEL 99 (/) MADE IN HONG KONG.
[Advertisement], Los Angeles Times, December 7, 1978, p. OC_A8. Calculator sells for $9.99.
[Advertisement], Washington Post, April 9, 1979, p. D10. Calculator listed as giveway of a bank to depositors of $5000 or more, $8.95 to depositors of $100-$1000.


But you know a Bible story has to be pretty compelling if it gets its own Broadway musical and a later movie version starring Donny Osmond. And the synopsis of the musical is mostly pretty true to the actual storyline of the biblical narrative. Just to refresh your memories (and because it's one of my favourite stories in the Bible), in the book of Genesis, Joseph is the favourite out of 12 sons of his father, Jacob, because he was the first born son of Jacob's favourite wife Rachel, who hadn't been able to bear children for many years.
As a sign of his favouritism, Jacob gives Joseph a "Coat of Many Colours" (which, as you can imagine, doesn't sound as good for the name of a Broadway musical as "Technicolour Dreamcoat"). Of course, this doesn't exactly make his 11 brothers very happy! What makes matters worse is that Joseph is a dreamer – and not in the John Lennon "Imagine" sense; no, Joseph receives prophetic dreams, dreams that contain messages from God. In at least two of these dreams he learns that he will one day rule over his 11 brothers, and in a fit of youthful naiveté, he shares this information with his brothers, who grow even more resentful.
Instead of killing Joseph as some of them wanted to do, they solve the problem by selling him into slavery; then they take his beautiful coat and splatter it with blood and they tell their father that his favourite son Joseph is dead.
But Joseph is not dead! In fact, he is taken to Egypt where he rises through the ranks of "employees" in the household of Potiphar, who was the captain of the palace guard, eventually reaching the heights of authority, second only to Potiphar himself. Potiphar's wife then tries to seduce Joseph and he flees the scene leaving his garment behind, refusing to sin against God by committing adultery. Potiphar's wife then uses the garment he left to make false accusations against him, and Potiphar throws Joseph in jail.
And they say the Bible is "boring." This one story has more drama than a whole season of Downton Abbey! And that's just Act 1 of the musical.
After that, Joseph is released from jail when it is discovered that he is a dream expert and the only one who can interpret the perplexing dreams that Pharaoh has been having; from those dreams, he is able to warn Pharaoh of a famine that will come to the land, but only after a period of abundance, so there is time to prepare by storing up grain. Joseph is given authority over the whole land of Egypt, second only to Pharaoh, and when the famine hits, Egypt is prepared.
Back at home, though, his brothers and his father Jacob are not faring as well. They hear that there is a surplus of grain in Egypt, so they go and find themselves bowing down to Joseph, completely unaware that it's their brother…until now. In the verses we heard this morning, Joseph reveals to his brothers that he is, in fact, the favourite son of Jacob who they sold off so many years before.
Understandably, their reaction to finding their long-lost brother is not celebratory. There they are, hungry, desperate and begging for food for their father and their wives and children, and they find out that the person they are dependent on is the one person who would have every right – and every authority – to throw them all into prison to starve to death. And the thing is, they know that's exactly what they deserve. They had sold him off and they thought that was the end of him, so they forgot about him and went on with their lives. But now here they are, face to face with the very person they wronged, confronted with their own guilt and wrong-doing from all those years ago. This was truly their past coming back to haunt them!
But Joseph doesn't respond how they thought he would; he doesn't respond the way they would have responded if they had been in his shoes. He doesn't respond the way I think I – and possibly many other people – might have responded to seeing them again. Other than the fact that he toys with them a little bit before revealing his true identity, we get the feeling he has been truly missing them all these years, and that he still deeply loves them. He is overcome with emotion at the sight of these men who had done such a horrible thing to him.
After all that he went through, how did Joseph not sink into bitterness, resentment and despair? Despite his kind and innocent demeanor, Joseph was betrayed by the ones closest to him when his own brothers sold him to a passing caravan of Ishmaelites. He had never meant anyone any harm, and yet they sold him – his own family. Betrayal – shakes our sense of security. Takes the rug out from under us, and the closer the people are to us, the more painful the betrayal feels. Betrayal by a stranger might make us angry, but betrayal by someone close to us makes us question our self-worth. That alone would have been enough for Joseph to condemn his brothers to starvation in an Egyptian prison.
There was even more pain added on top of that. After being his father's favourite son for so many years, he now had to get used to being a lowly servant in a stranger's house, in a foreign land, far away from his home, with no family, no friends, cut off from his culture and traditions. How did he not give up hope?
But he didn't. Instead of giving up hope, he worked hard in the house of Potiphar, who had bought him from the Ishmaelites. He stayed honest and caring. He demonstrated integrity. And the scripture tells us that "the Lord gave him success in everything he did," and the Lord blessed Potiphar's whole house because of Joseph.
Then Potiphar's wife falsely accuses him, and after having worked hard and been a good man, and having built himself a good life, he is betrayed again and subsequently sent to prison. Betrayed again, and now the victim of unthinkable injustice, Joseph now spends years in prison. But even there, he maintains his integrity; and it says "the Lord was with him and granted him favour in the eyes of the warden," and gave Joseph success in whatever he did.
The warden put Joseph in charge of other prisoners, when one of those prisoners – a member of Pharaoh's staff – is being released, he promises to put in a good word for Joseph. But once he himself is free, he forgets all about Joseph stuck there back in prison. And Joseph stays there two more years before the other prisoner remembers, and they call him to interpret Pharaoh's dream, and the rest, as they say, is history.
How does he go through all that, how does he endure that much suffering, but when he sees the men who are responsible for it all he says to them, "do not be distressed and do not be angry with yourselves for selling me here, because it was to save lives that God sent me ahead of you"?
How do we cope, and how do we come out of it when we have experienced devastating betrayal or unthinkable justice? How do we forgive? How does a mother even survive losing all seven of her children at once in a house fire in a strange land? How does a family recover from losing an 11-year-old girl at the hands of her own father? How do we get over it when our hearts are broken?
In the book Man's Search for Meaning, which has become one of the most influential books ever written, Viktor Frankl tells of his experience in a concentration camp during the Second World War, and describes the horrors of day to day life for the prisoners in heartbreaking detail. He reflects on the atrocities he witnessed, the suffering he endured, and the absolute injustice of it all, and he asks himself, "how is it possible for a human being to survive such a horror?" For Frankl, the answer lies in the prisoner's ability to envisage a future for himself for to find meaning, moment by moment, in the simple fact that he is alive.
In this, Frankl likes to quote Nietzsche, who wrote, "He who has a 'why' to live for can bear almost any 'how.'" Someone who can find meaning and purpose in their life, even in times of difficulty, can usually move forward moment by moment, without succumbing to despair. For Joseph – and for us as Christians – that meaning is to be found in the promises of God.
When my brother died in 2011 of lung cancer –despite being only 49 years old and a non-smoker – I felt like I had just learned what it really means for your heart to break. The grief, for my whole family, was heavy. But, like Frankl, I looked for the meaning that can be found in every moment of life, even the moments of suffering; and I realized that as I helped to take care of my brother in his final weeks, and as I comforted him when he took his last breath, I experienced a depth of love I had never experienced before. I discovered something new and powerful about myself: that I was capable of great personal sacrifice for the sake of someone I love. In his final weeks, I learned to be vulnerable in expressing my feelings – I learned how important it is to tell people that you love them. How important it is to allow yourself to love deeply. These are things that I would never have experienced or learned if I hadn't gone through the deeply painful experience of losing my brother.
Now, I want to be careful here, because I don't want you to misunderstand what I'm saying: I'm not saying that God put my brother through cancer in order to teach me these things. No, a loving God doesn't make other people sick in order to teach us life lessons. Nor am I saying "I'm so glad my brother went through that so that I could have this life experience." Of course not!
What I'm saying is that even out of the worst experiences of our lives, God can give us something that offers us a sense of meaning, of purpose, something that gives us comfort and hope. I cherish the memories of my brother and the conversations we had when he was sick and dying. They give me great comfort, even to this very day. Painful things are going to happen to us all in life, but we have a powerful and loving God who won't let the pain have the last word; who won't let the pain crush us, but rather he takes that pain and redeems it, and can turn it into something beautiful and something with purpose and meaning.
I'm also a different minister since losing him – when I meet with bereaved families, when I conduct funerals, when I counsel people going through difficult times, I have more to offer them than words or doctrines; I can offer them my heart; I can share their burden of grief. So there is more meaning found within the pain I experienced, as I can use it to help other people.
Don't get me wrong – I wish more than anything that I could have my brother back, but I can't; so what do I do with that? I look to God, who is the one who can give purpose and meaning to everything in life, so that despair does not have the last word.
Those things which would cause us harm, those things that have the power to crush our spirits, God can use for our good and for the good of others, just as he did with Joseph.
God is in control. A loving and merciful God is in control of all of the circumstances of our lives. That's what Joseph's experience shows us. I mean, after all that his brothers put him through, after all the suffering he has had to endure as a result, how could Joseph forgive possibly them out of his own human heart? For the human heart, it's impossible. How could he get past the fact that his own brothers were responsible for his suffering the loss of his family, and his painful time in prison?
Only by trusting in God and by keeping God's promises in his heart. When he was still just a young boy, God had shown him in a dream how this would all turn out, and even well into adulthood, Joseph trusted that God would be faithful to his promise and. So, like Frankl, he was able to find meaning in all that he had experienced – he found meaning in his brothers' betrayal; he found meaning in his time in prison. There was no way Joseph could have predicted that he would end up ruling the whole country of Egypt, second only to Pharaoh himself. But God had told Joseph in his dreams what the future would hold – that his brothers would bow down before him – and until that happened Joseph knew his story was not over. So Joseph clung to his hope in God moment by moment by moment.
Moment by moment, trusting in God was the only way he could get through the desperate situation, not knowing the future, but trusting that God was in control.
In so many ways, Joseph is a foreshadowing of Christ – he was betrayed by a friend whom he loved; he was punished unjustly and suffered more than anyone should ever have to suffer, even though he was perfectly innocent. And moment by moment, he trusted in the will of his Father, even unto death. And God did not fail him, but raised him to new life.
What is the promise that God has made to us in Christ? That suffering and despair will never have the last word in our lives. That death leads to resurrection in the hands of our Almighty Father. That despair will always give way to deliverance.
When it seems like there is chaos all around – in our lives, in the world – we can know and be assured that God is still in control, and that he can bring good out of what seems like the most desperate situation.
Because of Joseph's experience, we can know that God will be faithful to His promises to us. It may take years, or even decades; we may endure pain and adversity along the way. But we can cling to the promises of God that the pain and adversity are not the end of the story, just as they were not the end of Joseph's story.
If you are in a time of struggle, of pain or of despair, moment by moment look to God to guide you through it so that the thing you fear may bring you to harm can be redeemed by God, and used for a good and life-giving purpose. Amen.


The company relocating its Michigan headquarters a 100-year-old former vintage auto garage in Brush Park.
Real estate valuation firm BBG is relocating its Michigan headquarters to a 100-year-old former vintage auto garage in Brush Park.
The move — which will put BBG in the former administrative offices of the Heidelberg Project nonprofit — is an effort to show the firm's dedication and interest in Detroit.
"Our strategic move to Midtown reinforces our ongoing commitment to become part of the continuing redevelopment of Detroit," BBG Senior Managing Director Marc Nassif said in a statement.
BBG is a national real estate valuation company that specializes in making appraisals of commercial and multifamily buildings, as well as environmental and engineering consultations.
"We're the largest independent third-party due-diligence company," Nassif said, explaining that clients include lenders, attorneys, property owners and pension funds.
The company's corporate headquarters are in Dallas. The company opened its Michigan branch in 2011 in Livonia, where it served as a Midwest regional hub for a number of years.
"We came for opportunity, we were doing a lot of work in Detroit," Nassif said, noting that he knows they are the first national real estate valuation firm to move to Detroit proper based off his knowledge of his competitors.
The company's new home will be at 42 Watson St. in a two-story, 9,000-square-foot building that the company will share with two other commercial real estate companies, bringing about 100 jobs to the building between the three companies, according to BBG. Additionally, the Second Best Bar, a new bar, and restaurant will be on the first floor.
According to Crain's, the building was purchased in December for $1.15 million by an entity called Detrel LLC. The Heidelberg Project is an internationally recognized folk art installation. The nonprofit's offices, which had been at the Brush Park location for eight years, moved temporarily to West Village in Detroit after the deal closed.


text:
Federal Defense
⇒ NavigateHome Practice Areas Federal Defense Recent Results About Us Contact Us
toll free800-834-6434local805-273-5611
I am Here Because
I don't know if I need an attorney. Click here for more information.
Why Hire Robert M. Helfend?
In the face of an arrest you need the best. Click here to learn more about attorney Robert M. Helfend.
Trio Convicted in Thousand Oaks Bank Robberies
Posted on February 2, 2014 by Robert Helfend
Two Thousand Oaks men have each pleaded guilty to a single felony count of street terrorism and two counts second-degree robbery. The plea stems from a pair of bank robberies the trio committed in Thousand Oaks in early- and mid-2013. The two men admitted to robbing the same Citibank branch in Thousand Oaks twice within four months.
Because both male defendants have admitted to prior felonies and have special enhancements related to the robberies, they are expected to receive a prison term of twelve years. A third person, a 21-year old female, served as the getaway driver for both robberies and is currently serving a five-year sentence for one count each of street terrorism and robbery.
What is "street terrorism" and when is this charge applied? The California Street Terrorism Enforcement and Prevention (STEP) Act of 1988 introduced the crime of "street terrorism." The Act was designed to curb crimes committed in support of gang activities in California. The Act is defined under the California Penal Code Section 186.2, and makes it a crime to be a member of a street gang and assist in criminal activities designed to support the gang or its members.
Participation in a street gang can be punished by detention in the county jail for a period of not more than one year, or by prison terms ranging from 16 months to three years, depending upon the circumstances surrounding the crime. Most STEP enhancements can extend prison sentences by as much as 15 years. For certain convictions, STEP enhancements can extend a prison sentence by 25 years to life in prison! Street terrorism sentences are served consecutively with any other sentences applied by a Judge, meaning that they are served in addition to any other sentences.
You do not need to be a member of a street gang to be charged with a STEP offense. If you merely aid a gang member in the commission of a gang-related felony, you can be convicted under the STEP Act. The seriousness of a STEP Act charge and the accompanying prison terms mean that you need the help of a competent criminal defense.
Robert M. Helfend is a criminal defense attorney in Ventura County, and has successfully defended clients facing California criminal charges for 30 years. Mr. Helfend provides aggressive criminal defense in Ventura County. For a consultation on your case involving STEP Act violations, contact the Law Offices of Robert M. Helfend toll-free at (800) 834-6434 or locally at (805) 273-5611, (310) 456-3317, or (818) 591-2809. Robert M. Helfend is an experienced criminal defense attorney who can help you!
Posted in Armed Robbery.
Contact Mr. Helfend Today
We offer a FREE review of your case.
California Three Strikes Law
Federal Drug Conspiracy
Felony Expungements
'Lewd Acts With a Minor'
Robbery & Armed Robbery
Solicitation of a Minor
Solicitation of a Prostitute
⇒ NavigateBreaking and Entering Embezzlement California Three Strikes Law Child Molestation Child Pornography Cryptocurrency Domestic Violence Drug Crimes Embezzlement Federal Criminal Defense Federal Drug Conspiracy Felony Expungements Felony Murder Fraud Grand Theft Identity Theft Indecent Exposure Insider Trading Internet Crimes 'Lewd Acts With a Minor' Marijuana Murder Rape Robbery & Armed Robbery Sex Crimes Solicitation of a Minor Solicitation of a Prostitute Statutory Rape Tax Evasion
Pro Bono Policy
⇒ NavigateContact Us Los Angeles Office Pro Bono Policy Privacy Policy Scholarship Sitemap
Robert M. Helfend Criminal Defense Attorney
45 South California St. Ste 9
Ventura, CA 93001.
Local Phone Number: 805-273-5611
Robert M. Helfend, Criminal Defense Attorney - Ventura Criminal Defense Lawyer
Located at 45 South California St. Ste 9 Ventura, CA 93001.
© 2020 Robert M. Helfend, all rights reserved.

redpajama_set_name: RedPajamaCommonCrawl