class_docstr: Class for defining how to save/restore DTensor variable.
class_docstr_tok: ["Class","for","defining","how","to","save\/restore","DTensor","variable","."]
docstr: Returns True if v has float32 dtype and is intructed to save as bf16.
  
  Args:
    v : The variable that determines whether to cast.
  
  Returns:
    True if current savable DVariable is instructed to save as bfloat16 and
      the variable has dtype float32.
docstr_tok: ["Returns","True","if","v","has","float32","dtype","and","is","intructed","to","save","as","bf16",".","Args",":","v",":","The","variable","that","determines","whether","to","cast",".","Returns",":","True","if","current","savable","DVariable","is","instructed","to","save","as","bfloat16","and","the","variable","has","dtype","float32","."]
code: def should_cast(self, v):
      """Returns True if v has float32 dtype and is intructed to save as bf16.
  
      Args:
        v : The variable that determines whether to cast.
  
      Returns:
        True if current savable DVariable is instructed to save as bfloat16 and
          the variable has dtype float32.
      """
      return self._dvariable.save_as_bf16 and v.dtype == dtypes.float32
  
imports: import functools
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import layout
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.trackable import base
  from tensorflow.python.training.saving import saveable_object
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling the _DVariableSaveable obj's underlying member method code with example usage: obj.should_cast(v) and returns: unknown