(self, x)
return torch.stack(n_samples * [normalized], dim=0)
Perform forward pass.

        Parameters
        ----------
        x : torch.Tensor
            Tensor of shape `(n_samples, dim_1, ...., dim_N)`.

        Returns
        -------
        weights : torch.Tensor
            Tensor of shape `(n_samples, n_assets`).
Perform forward pass.
Perform forward pass .
def forward(self, x):
        """Perform forward pass.

        Parameters
        ----------
        x : torch.Tensor
            Tensor of shape `(n_samples, dim_1, ...., dim_N)`.

        Returns
        -------
        weights : torch.Tensor
            Tensor of shape `(n_samples, n_assets`).

        """
        n_samples = x.shape[0]
        clamped = torch.clamp(self.asset_weights, min=0)
        normalized = clamped / clamped.sum()

        return torch.stack(n_samples * [normalized], dim=0)
def forward ( self , x ) : n_samples = x . shape [ 0 ] clamped = torch . clamp ( self . asset_weights , min = 0 ) normalized = clamped / clamped . sum ( ) return torch . stack ( n_samples * [ normalized ] , dim = 0 )