From 97fcb9d4b13a3534259eec522a0e2984ec66f2c7 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Tue, 13 Aug 2024 11:33:54 -0700 Subject: [PATCH] init --- torchrl/modules/models/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/torchrl/modules/models/models.py b/torchrl/modules/models/models.py index 23c229c6524..b5c60a212f1 100644 --- a/torchrl/modules/models/models.py +++ b/torchrl/modules/models/models.py @@ -5,6 +5,7 @@ from __future__ import annotations import dataclasses +import warnings from copy import deepcopy from numbers import Number @@ -179,8 +180,15 @@ def __init__( if out_features is None: raise ValueError("out_features must be specified for MLP.") - default_num_cells = 32 if num_cells is None: + warnings.warn( + "The current behaviour of MLP when not providing `num_cells` is that the number of cells is " + "set to [default_num_cells] * depth, where `depth=3` by default and `default_num_cells=0`. " + "From v0.7, this behaviour will switch and `depth=0` will be used. " + "To silence tis message, indicate what number of cells you desire.", + category=DeprecationWarning, + ) + default_num_cells = 32 if depth is None: num_cells = [default_num_cells] * 3 depth = 3