def _resolve_type()

in src/sagemaker_training/recordio.py [0:0]


def _resolve_type(dtype):
    """Return the type string corresponding to the numpy.dtype.

    Args:
        dtype (numpy.dtype or str): numpy.dtype object.

    Returns:
        (str): String corresponding to the dtype.
    """
    if dtype == np.dtype(int):
        return "Int32"
    if dtype == np.dtype(float):
        return "Float64"
    if dtype == np.dtype("float32"):
        return "Float32"
    raise ValueError("Unsupported dtype {} on array".format(dtype))