def compare(reference, result, dtype):
  """ Compare result.

  Args:
    reference: Correct result
    result: Output result
    dtype: Data type of model

  Returns:
    True for success and False for failure.
  """
  if not reference:
    print("No verify_files file or verify_files err.")
    return True
  ref = reference[dtype]
  ret = True
  if result != ref:
    ret = False
  if not ret:
    print("Result compare failed!")
    print("Expected result: {}".format(ref))
  return ret