torchrl-nightly 2025.7.18__cp312-cp312-macosx_10_13_universal2.whl → 2025.7.19__cp312-cp312-macosx_10_13_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -4430,12 +4430,14 @@ class Binary(Categorical):
4430
4430
  raise ValueError(
4431
4431
  f"'n' must be zero for spec {self.__class__} when using an empty shape"
4432
4432
  )
4433
- else:
4433
+ elif n is not None:
4434
4434
  if shape[-1] != n:
4435
4435
  raise ValueError(
4436
4436
  f"The last value of the shape must match 'n' for spec {self.__class__}. "
4437
4437
  f"Got n={n} and shape={shape}."
4438
4438
  )
4439
+ else:
4440
+ n = shape[-1]
4439
4441
 
4440
4442
  super().__init__(n=2, shape=shape, device=device, dtype=dtype)
4441
4443
  self.encode = self._encode_eager
@@ -4449,7 +4451,7 @@ class Binary(Categorical):
4449
4451
  f"shape of the {self.__class__.__name__} spec in expand()."
4450
4452
  )
4451
4453
  return self.__class__(
4452
- n=self.shape[-1] if len(self.shape) > 0 else None,
4454
+ n=shape[-1] if len(shape) > 0 else None,
4453
4455
  shape=shape,
4454
4456
  device=self.device,
4455
4457
  dtype=self.dtype,
@@ -4457,7 +4459,7 @@ class Binary(Categorical):
4457
4459
 
4458
4460
  def _reshape(self, shape):
4459
4461
  return self.__class__(
4460
- n=self.shape[-1] if len(self.shape) > 0 else None,
4462
+ n=shape[-1] if len(shape) > 0 else None,
4461
4463
  shape=shape,
4462
4464
  device=self.device,
4463
4465
  dtype=self.dtype,
@@ -4470,7 +4472,7 @@ class Binary(Categorical):
4470
4472
  .shape
4471
4473
  )
4472
4474
  return self.__class__(
4473
- n=self.shape[-1] if len(self.shape) > 0 else None,
4475
+ n=shape[-1] if len(shape) > 0 else None,
4474
4476
  shape=shape,
4475
4477
  device=self.device,
4476
4478
  dtype=self.dtype,
@@ -4481,7 +4483,7 @@ class Binary(Categorical):
4481
4483
  if shape is None:
4482
4484
  return self
4483
4485
  return self.__class__(
4484
- n=self.shape[-1] if len(self.shape) > 0 else None,
4486
+ n=shape[-1] if len(shape) > 0 else None,
4485
4487
  shape=shape,
4486
4488
  device=self.device,
4487
4489
  dtype=self.dtype,
@@ -4490,7 +4492,7 @@ class Binary(Categorical):
4490
4492
  def unsqueeze(self, dim: int):
4491
4493
  shape = _unsqueezed_shape(self.shape, dim)
4492
4494
  return self.__class__(
4493
- n=self.shape[-1] if len(self.shape) > 0 else None,
4495
+ n=shape[-1] if len(shape) > 0 else None,
4494
4496
  shape=shape,
4495
4497
  device=self.device,
4496
4498
  dtype=self.dtype,
@@ -4510,7 +4512,7 @@ class Binary(Categorical):
4510
4512
  shape = tuple(s for i, s in enumerate(self.shape) if i != dim)
4511
4513
  return tuple(
4512
4514
  self.__class__(
4513
- n=self.shape[-1] if len(self.shape) > 0 else None,
4515
+ n=shape[-1] if len(shape) > 0 else None,
4514
4516
  shape=shape,
4515
4517
  device=self.device,
4516
4518
  dtype=self.dtype,
torchrl/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = '2025.7.18'
2
- git_version = '4001d9cb73cea4498b0fdfe420effc58a5a336be'
1
+ __version__ = '2025.7.19'
2
+ git_version = '163e23f9c930b58990287206958e2e036af5b902'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: torchrl-nightly
3
- Version: 2025.7.18
3
+ Version: 2025.7.19
4
4
  Home-page: https://github.com/pytorch/rl
5
5
  Author: torchrl contributors
6
6
  Author-email: vmoens@fb.com
@@ -3,9 +3,9 @@ build_tools/setup_helpers/__init__.py,sha256=7l8TvVqxKezgzKCLuRv20mvGLloprFVZYm8
3
3
  build_tools/setup_helpers/extension.py,sha256=4-PDLr-pw40bJnd9SfxnTaSjUyuXU_Tg8yOg69Kl0o4,5914
4
4
  torchrl/__init__.py,sha256=mhDBx2UIuBKc0gmi8dVNHokQ6tCbIovruZmyAxcSsy8,2938
5
5
  torchrl/_extension.py,sha256=z7wQ8i1iYWYcnygq_j0nq9sT-koY13tfHhTLNbMk17Q,2353
6
- torchrl/_torchrl.cpython-312-darwin.so,sha256=k_jisocYRQ0Z1X52Pu2ym9-02BXMnLrD7q0fOpElam8,1692224
6
+ torchrl/_torchrl.cpython-312-darwin.so,sha256=4Ad5Nb4Gnbgvl0g_aVkBSsGJtjxka7gplR6UZiQ3-7g,1692224
7
7
  torchrl/_utils.py,sha256=Cw5EG6x5oSZF1iE3YCs1a32VUKp0rTXIs2u67q9zKUI,41078
8
- torchrl/version.py,sha256=MHs4CxNjQupYI_f84bY7dOAAfPSU9yN6TOyxiS7tS8c,83
8
+ torchrl/version.py,sha256=n7bZHGPZ1ZnUt9WqWLyrTICG9OX_i1Q-9iAARTUGQ4Q,83
9
9
  torchrl/collectors/__init__.py,sha256=hJ3JD6shRku0BL6SzJQq44FZ5Q1RGR8LealFyU3FRn4,799
10
10
  torchrl/collectors/collectors.py,sha256=HpaW-y0bQOaOql8_7VyEPJ084CulrVwn6iBpGYoHyH4,178287
11
11
  torchrl/collectors/utils.py,sha256=MlXrkYuDmV0Em-tVNQiLL32FWgPNDgceYYG_GgpiviA,11320
@@ -25,7 +25,7 @@ torchrl/collectors/llm/weight_update/__init__.py,sha256=bKjvD7yZG5VnHgvYc4EmKI1s
25
25
  torchrl/collectors/llm/weight_update/vllm.py,sha256=slKUmrIo4eL6R4J1oEnmlP6Q7Zer09p92JU8zbIHFUM,11515
26
26
  torchrl/data/__init__.py,sha256=oowsio6ZUOZnJV8JV43xgs17B37XO1yKAYIQPdk8yt0,4819
27
27
  torchrl/data/rlhf.py,sha256=JUmdYBWgkN229DwpXuDrhy9ddjduNvU2kyHzHR6MoA0,963
28
- torchrl/data/tensor_specs.py,sha256=RlMckj6PJo9MQMzneHzbcVe9xUyMB_n7pnSz0jytB9s,253907
28
+ torchrl/data/tensor_specs.py,sha256=-Yt8ER7YWvQf06upVm4npkLY9HBzoOJ3YUT37AOL3FE,253901
29
29
  torchrl/data/utils.py,sha256=attuNwzfgjszyp0lJSrV06f2peX3r0qTjRZWEwfl6Yg,12108
30
30
  torchrl/data/datasets/__init__.py,sha256=NQpXsHecbZmza8AocX9mkqQQNkdFzeUrMTZoi6hbbU4,733
31
31
  torchrl/data/datasets/atari_dqn.py,sha256=3ij6-UGfKev-QJuUEhZEEmn_3yL210CqKJALaFvlc5M,40739
@@ -223,8 +223,8 @@ torchrl/trainers/helpers/losses.py,sha256=sHlJqjh02t8cKN73X35Azd_OoWGurohLuviB8Y
223
223
  torchrl/trainers/helpers/models.py,sha256=ihTERG2c96E8cS3Tnul6a_ys6iDEEJmHh05p9blQTW8,21807
224
224
  torchrl/trainers/helpers/replay_buffer.py,sha256=ZUZHOa0TILyeWJ3iahzTJ6UvMl_0FdxuZfJEja94Bn8,2001
225
225
  torchrl/trainers/helpers/trainers.py,sha256=j6B5XA7_FFHMQeOIQwjNcO0CGE_4mZKUC9_jH_iqqh4,12071
226
- torchrl_nightly-2025.7.18.dist-info/licenses/LICENSE,sha256=xdjS4_xk-IwnLuIFCvTYTl9Y8aXRejqpmke3dGam_nI,1098
227
- torchrl_nightly-2025.7.18.dist-info/METADATA,sha256=K_Nmn84sw1xeD28lqIPqdhLjdaFchSMXuG2vjAajTn0,42990
228
- torchrl_nightly-2025.7.18.dist-info/WHEEL,sha256=9_3tTSxMJq-dgdzMiScNvtT5eTBVd3l6RgHS7HwTzpA,115
229
- torchrl_nightly-2025.7.18.dist-info/top_level.txt,sha256=JeTJ1jV7QJwLcUS1nr21aPn_wb-XlAZ9c-z_EH472JA,20
230
- torchrl_nightly-2025.7.18.dist-info/RECORD,,
226
+ torchrl_nightly-2025.7.19.dist-info/licenses/LICENSE,sha256=xdjS4_xk-IwnLuIFCvTYTl9Y8aXRejqpmke3dGam_nI,1098
227
+ torchrl_nightly-2025.7.19.dist-info/METADATA,sha256=C0nxjedQsznrXBcFdop1QrOtdDH6LiA_41_iJWSaMgQ,42990
228
+ torchrl_nightly-2025.7.19.dist-info/WHEEL,sha256=9_3tTSxMJq-dgdzMiScNvtT5eTBVd3l6RgHS7HwTzpA,115
229
+ torchrl_nightly-2025.7.19.dist-info/top_level.txt,sha256=JeTJ1jV7QJwLcUS1nr21aPn_wb-XlAZ9c-z_EH472JA,20
230
+ torchrl_nightly-2025.7.19.dist-info/RECORD,,