code: def _check_asset_node_def(node_def):
    
    if node_def.op != "Const":
      raise TypeError("Asset node must be of type constant.")
    if tf.as_dtype(node_def.attr["dtype"].type) != tf.string:
      raise TypeError("Asset node must be of dtype string.")
    if len(node_def.attr["value"].tensor.string_val) != 1:
      raise TypeError("Asset node must be a scalar.")
docs: Raises TypeError if `node_def` does not match the expectations.