<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def range_type_to_dtype(range_type: str) -> Optional[tf.DType]:
    '''Maps RDDL range types to TensorFlow dtypes.'''
    range2dtype = {
        'real': tf.float32,
        'int': tf.int32,
        'bool': tf.bool
    }
    return range2dtype[range_type]