parameters: (arr, label=0)
return_statement: return datum
docstring: Converts a 3-dimensional array to datum. If the array has dtype uint8,
      the output data will be encoded as a string. Otherwise, the output data
      will be stored in float format.
docstring_summary: Converts a 3-dimensional array to datum. If the array has dtype uint8,
      the output data will be encoded as a string. Otherwise, the output data
      will be stored in float format.
docstring_tokens: Converts a 3 - dimensional array to datum . If the array has dtype uint8 the output data will be encoded as a string . Otherwise the output data will be stored in float format .
function: def array_to_datum(arr, label=0):
      """Converts a 3-dimensional array to datum. If the array has dtype uint8,
      the output data will be encoded as a string. Otherwise, the output data
      will be stored in float format.
      """
      if arr.ndim != 3:
          raise ValueError('Incorrect array shape.')
      datum = caffe_pb2.Datum()
      datum.channels, datum.height, datum.width = arr.shape
      if arr.dtype == np.uint8:
          datum.data = arr.tostring()
      else:
          datum.float_data.extend(arr.flat)
      datum.label = label
      return datum
function_tokens: def array_to_datum ( arr , label = 0 ) : if arr . ndim != 3 : raise ValueError ( 'Incorrect array shape.' ) datum = caffe_pb2 . Datum ( ) datum . channels , datum . height , datum . width = arr . shape if arr . dtype == np . uint8 : datum . data = arr . tostring ( ) else : datum . float_data . extend ( arr . flat ) datum . label = label return datum