Aggregation Functions

condensa.functional.l2norm(tensor, dim, keepdim)

Computes the l2-norm of elements in input tensor.

Parameters
  • tensor (torch.nn.Module) – PyTorch tensor.

  • dim (int) – Reduction dimension.

  • keepdim (bool) – Whether the output has dim retained.

Returns

l2-norm of input tensor.

condensa.functional.max(tensor, dim, keepdim)

Computes the maximum value of elements in input tensor.

Parameters
  • tensor (torch.nn.Module) – PyTorch tensor.

  • dim (int) – Reduction dimension.

  • keepdim (bool) – Whether the output has dim retained.

Returns

Max of input tensor.

condensa.functional.mean(tensor, dim, keepdim)

Computes the mean value of elements in input tensor.

Parameters
  • tensor (torch.nn.Module) – PyTorch tensor.

  • dim (int) – Reduction dimension.

  • keepdim (bool) – Whether the output has dim retained.

Returns

Mean value of input tensor.

condensa.functional.min(tensor, dim, keepdim)

Computes the minimum value of elements in input tensor.

Parameters
  • tensor (torch.nn.Module) – PyTorch tensor.

  • dim (int) – Reduction dimension.

  • keepdim (bool) – Whether the output has dim retained.

Returns

Min of input tensor.

condensa.functional.sum(tensor, dim, keepdim)

Computes the sum of elements in input tensor.

Parameters
  • tensor (torch.nn.Module) – PyTorch tensor.

  • dim (int) – Reduction dimension.

  • keepdim (bool) – Whether the output has dim retained.

Returns

Sum of input tensor.