import torch


def _flatten_tuple(observation):
    """Assumes observation is a tuple of tensors. converts ((n,c, h, w),(n, x)) -> (n,c*h*w+x)"""
    image, fc = observation
    flat = image.view(image.shape[0], -1)
    return torch.cat((flat, fc), dim=1)