class_docstr: Adafactor.
docstr: Should we use a factored second moment estimator.
  
  Based on the shape of the variable.
  If we factor the accumulator, then this function returns a list of two
  mtf.Dimensions to reduce over.  We always pick the two largest dimensions.
  If there are not two dimensions of size >= min_dim_size_to_factor, then we
  do not factor.
  
  Args:
    shape: a Shape
  Returns:
    either a list of 2 Dimensions or None
docstr_tok: ["Should","we","use","a","factored","second","moment","estimator",".","Based","on","the","shape","of","the","variable",".","If","we","factor","the","accumulator",",","then","this","function","returns","a","list","of","two","mtf.Dimensions","to","reduce","over",".","We","always","pick","the","two","largest","dimensions",".","If","there","are","not","two","dimensions","of","size",">","=","min_dim_size_to_factor",",","then","we","do","not","factor",".","Args",":","shape",":","a","Shape","Returns",":","either","a","list","of","2","Dimensions","or","None"]
code: def _factored_dims(self, shape):
      """Should we use a factored second moment estimator.
  
      Based on the shape of the variable.
      If we factor the accumulator, then this function returns a list of two
      mtf.Dimensions to reduce over.  We always pick the two largest dimensions.
      If there are not two dimensions of size >= min_dim_size_to_factor, then we
      do not factor.
  
      Args:
        shape: a Shape
      Returns:
        either a list of 2 Dimensions or None
      """
      if not self._factored:
          return None
      dims = [
          d for d in shape.dims if d.name not in self._stacked_dim_names
      ]
      if len(dims) < 2:
          return None
      sorted_dims = sorted(dims, key=lambda d: -d.size)
      if sorted_dims[1].size < self._min_dim_size_to_factor:
          return None
      return sorted_dims[:2]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import re
  import gin
  from mesh_tensorflow import layers
  from mesh_tensorflow import ops_with_redefined_builtins
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the AdafactorOptimizer obj's underlying member method code with example usage: obj._factored_dims(shape) and returns: sorted_dims, None, None, None