parameters: (self, v)
docstring: Get an `OperatorPDIdentity` to play the role of `D` in `VDV^T`.
docstring_summary: Get an `OperatorPDIdentity` to play the role of `D` in `VDV^T`.
docstring_tokens: Get an OperatorPDIdentity to play the role of D in VDV^T .
function: def _get_identity_operator(self, v):
      """Get an `OperatorPDIdentity` to play the role of `D` in `VDV^T`."""
      with ops.name_scope("get_identity_operator", values=[v]):
        if v.get_shape().is_fully_defined():
          v_shape = v.get_shape().as_list()
          v_batch_shape = v_shape[:-2]
          r = v_shape[-1]
          id_shape = v_batch_shape + [r, r]
        else:
          v_shape = array_ops.shape(v)
          v_rank = array_ops.rank(v)
          v_batch_shape = array_ops.slice(v_shape, [0], [v_rank - 2])
          r = array_ops.gather(v_shape, v_rank - 1)  # Last dim of v
          id_shape = array_ops.concat(0, (v_batch_shape, [r, r]))
        return operator_pd_identity.OperatorPDIdentity(
            id_shape, v.dtype, verify_pd=self._verify_pd)
function_tokens: def _get_identity_operator ( self , v ) : with ops . name_scope ( "get_identity_operator" , values = [ v ] ) : if v . get_shape ( ) . is_fully_defined ( ) : v_shape = v . get_shape ( ) . as_list ( ) v_batch_shape = v_shape [ : - 2 ] r = v_shape [ - 1 ] id_shape = v_batch_shape + [ r , r ] else : v_shape = array_ops . shape ( v ) v_rank = array_ops . rank ( v ) v_batch_shape = array_ops . slice ( v_shape , [ 0 ] , [ v_rank - 2 ] ) r = array_ops . gather ( v_shape , v_rank - 1 ) # Last dim of v id_shape = array_ops . concat ( 0 , ( v_batch_shape , [ r , r ] ) ) return operator_pd_identity . OperatorPDIdentity ( id_shape , v . dtype , verify_pd = self . _verify_pd )