Dummy Torch Model

A small dummy model specifically for unit and integration testing purposes

class flood_forecast.transformer_xl.dummy_torch.DummyTorchModel(forecast_length: int)[source]
__init__(forecast_length: int)[source]

A dummy model that will return a tensor of ones (batch_size, forecast_len)

Parameters

forecast_length (int) – The length to forecast

forward(x: torch.Tensor) torch.Tensor[source]

The forward pass for the dummy model

Parameters
  • x (torch.Tensor) – Here the data is irrelvant. Only batch_size is grabbed

  • mask ([type], optional) – [description], defaults to None

Returns

A tensor with fixed data of one

Return type

torch.Tensor

training: bool