class_docstr: Base class for Tensor wrappers.
  
  Implements ops that manipulate the backing tensors of Tensor wrappers
  (e.g. DateTensor, PeriodTensor). These ops are mostly about reshaping the
  backing tensors, such as tf.reshape, tf.expand_dims, tf.stack, etc. Also
  includes indexing and slicing.
  
  Inheritors must implement _apply_op(self, op_fn) and provide a static method
  _apply_sequence_to_tensor_op(op_fn, tensors). For example:
  
  ```python
  class MyWrapper(TensorWrapper):
    def __init__(self, backing_tensor):
       self._backing_tensor = backing_tensor
  
    def _apply_op(self, op_fn):
      new_backing_tensor = op_fn(self._backing_tensor)
      return MyWrapper(new_backing_tensor)
  
    @staticmethod
    def _apply_sequence_to_tensor_op(op_fn, tensors):
      new_backing_tensor = op_fn([t._backing_tensor for t in tensors])
      return MyWrapper(new_backing_tensor)
  ```
  
  Then 'MyWrapper` can be used as follows:
  
  ```python
  m1 = MyWrapper(tf.constant([[1, 2, 3], [4, 5, 6]]))
  m2 = MyWrapper(...)
  m3 = m1[0, 1:-1]
  m4 = m1.expand_dims(axis=-1)
  m5 = MyWrapper.concat((m1, m2), axis=-1)
  # etc.
  ```
class_docstr_tok: ["Base","class","for","Tensor","wrappers",".","Implements","ops","that","manipulate","the","backing","tensors","of","Tensor","wrappers","(","e.g",".","DateTensor",",","PeriodTensor",")",".","These","ops","are","mostly","about","reshaping","the","backing","tensors",",","such","as","tf.reshape",",","tf.expand_dims",",","tf.stack",",","etc",".","Also","includes","indexing","and","slicing",".","Inheritors","must","implement","_apply_op","(","self",",","op_fn",")","and","provide","a","static","method","_apply_sequence_to_tensor_op","(","op_fn",",","tensors",")",".","For","example",":","``","`","python","class","MyWrapper","(","TensorWrapper",")",":","def","__init__","(","self",",","backing_tensor",")",":","self._backing_tensor","=","backing_tensor","def","_apply_op","(","self",",","op_fn",")",":","new_backing_tensor","=","op_fn","(","self._backing_tensor",")","return","MyWrapper","(","new_backing_tensor",")","@","staticmethod","def","_apply_sequence_to_tensor_op","(","op_fn",",","tensors",")",":","new_backing_tensor","=","op_fn","(","[","t._backing_tensor","for","t","in","tensors","]",")","return","MyWrapper","(","new_backing_tensor",")","``","`","Then","'MyWrapper","`","can","be","used","as","follows",":","``","`","python","m1","=","MyWrapper","(","tf.constant","(","[","[","1",",","2",",","3","]",",","[","4",",","5",",","6","]","]",")",")","m2","=","MyWrapper","(","...",")","m3","=","m1","[","0",",","1",":","-1","]","m4","=","m1.expand_dims","(","axis=-1",")","m5","=","MyWrapper.concat","(","(","m1",",","m2",")",",","axis=-1",")","#","etc",".","``","`"]
docstr: See tf.concat.
docstr_tok: ["See","tf.concat","."]
code: def concat(cls, tensor_wrappers, axis):
      """See tf.concat."""
      cls._validate_tensor_types(tensor_wrappers, "concat")
      return cls._apply_sequence_to_tensor_op(
          lambda ts: tf.concat(ts, axis), tensor_wrappers
      )
  
file_path: tf-quant-finance/tf_quant_finance/datetime/tensor_wrapper.py
imports: import abc
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling the TensorWrapper obj's underlying member method code with example usage: obj.concat(cls, tensor_wrappers, axis) and returns: cls