src/proteingnn/model.py
def _concat_step_output(outputs: List[Dict[str, torch.Tensor]], dim: int = 0, skip: Iterable = ('loss',))\
        -> Dict[str, torch.Tensor]:
    """Concatenate step output into single batch tensor.

    Args:
        outputs: Outputs from train/validation/test_step.
        dim: Dimension to be concatenated.
        skip: Keys to be skipped in outputs.
    """
    data = {}
    for output in outputs:
        for key, var in output.items():
            if key in skip:
                continue

            if key in data:
                data[key].append(var)
            else:
                data[key] = [var]

    for key in data:
        data[key] = torch.cat(data[key], dim=dim).clone().detach().cpu()

    return data
Concatenate step output into single batch tensor.

    Args:
        outputs: Outputs from train/validation/test_step.
        dim: Dimension to be concatenated.
        skip: Keys to be skipped in outputs.
    
Concatenate step output into single batch tensor.
Concatenate step output into single batch tensor .
def _concat_step_output(outputs: List[Dict[str, torch.Tensor]], dim: int = 0, skip: Iterable = ('loss',))\
        -> Dict[str, torch.Tensor]:
    data = {}
    for output in outputs:
        for key, var in output.items():
            if key in skip:
                continue
            if key in data:
                data[key].append(var)
            else:
                data[key] = [var]
    for key in data:
        data[key] = torch.cat(data[key], dim=dim).clone().detach().cpu()
    return data
def _concat_step_output ( outputs : List [ Dict [ str , torch . Tensor ] ] , dim : int = 0 , skip : Iterable = ( 'loss' , ) ) -> Dict [ str , torch . Tensor ] : data = { } for output in outputs : for key , var in output . items ( ) : if key in skip : continue if key in data : data [ key ] . append ( var ) else : data [ key ] = [ var ] for key in data : data [ key ] = torch . cat ( data [ key ] , dim = dim ) . clone ( ) . detach ( ) . cpu ( ) return data
Concatenate step output into single batch tensor.
Concatenate step output into single batch tensor .
"""Concatenate step output into single batch tensor.

    Args:
        outputs: Outputs from train/validation/test_step.
        dim: Dimension to be concatenated.
        skip: Keys to be skipped in outputs.
    """
outputs
List[Dict[str, torch.Tensor]]
Outputs from train/validation/test_step.
Outputs from train / validation / test_step .
dim
int
Dimension to be concatenated.
Dimension to be concatenated .
skip
Iterable
Keys to be skipped in outputs.
Keys to be skipped in outputs .