coord_conv

The coordinate convolution class.

class mfai.pytorch.models.gan_dgmr.layers.coord_conv.AddCoords(with_r=False)[source]

Bases: Module

Argument input tensors with spatial information.

Parameters:

with_r (bool)

forward(input_tensor)[source]

Add spatial information to the input tensor.

Parameters:

input_tensor (Tensor) – shape(batch, channel, x_dim, y_dim)

Return type:

Tensor

class mfai.pytorch.models.gan_dgmr.layers.coord_conv.CoordConv(in_channels, out_channels, with_r=False, **kwargs)[source]

Bases: Module

Coordinate convolution class.

Parameters:
  • in_channels (int)

  • out_channels (int)

  • with_r (bool)

  • kwargs (Any)

forward(x)[source]

Apply a forward pass on the input tensor.

Return type:

Tensor

Parameters:

x (Tensor)