trw.layers.flatten

Module Contents

Classes

Flatten

Flatten a tensor

Functions

flatten(x)

Flatten a tensor

trw.layers.flatten.flatten(x)

Flatten a tensor

Example, a tensor of shape[N, Z, Y, X] will be reshaped [N, Z * Y * X]

Parameters

x – a tensor

Returns: return a flattened tensor

class trw.layers.flatten.Flatten

Bases: torch.nn.Module

Flatten a tensor

For example, a tensor of shape[N, Z, Y, X] will be reshaped [N, Z * Y * X]

forward(self, x)
Parameters

x – a tensor

Returns: return a flattened tensor