def compute_icm_reward(model: ICMNetwork, states: Tensor, actions: Tensor, next_states: Tensor) -> None:
    """
    **Overview**:
        A function that calculates the ICM intrinsic reward using the trained ICM model.
    """
    # Compute the normalized ICM reward.
    icm_reward = model.compute_icm_intrinsic_reward(states, actions, next_states)
    # Print the ICM intrinsic reward.
    print(f"ICM intrinsic reward: {icm_reward}")
    # Assert that the ICM reward has the correct shape, dtype, and value range.
    assert icm_reward.shape == (states.shape[0],)
    assert icm_reward.dtype == torch.float32
    assert icm_reward.max() <= 1.0 and icm_reward.min() >= 0.0

    **Overview**:
        A function that calculates the ICM intrinsic reward using the trained ICM model.
    
chapter4_reward/curiosity_icm.py