-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] min, amin, max, amax, cummin, cummax
ghstack-source-id: 9873c08f98e84b372c6f701a3326e900454dc1d0 Pull Request resolved: #1057
- Loading branch information
Showing
6 changed files
with
414 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
from tensordict.tensorclass import tensorclass | ||
from tensordict.tensordict import TensorDict | ||
|
||
|
||
@tensorclass | ||
class min: | ||
"""A `min` tensorclass to be used as a result for :meth:`~tensordict.TensorDict.min` operations.""" | ||
|
||
vals: TensorDict | ||
indices: TensorDict | ||
|
||
|
||
@tensorclass | ||
class max: | ||
"""A `max` tensorclass to be used as a result for :meth:`~tensordict.TensorDict.max` operations.""" | ||
|
||
vals: TensorDict | ||
indices: TensorDict | ||
|
||
|
||
@tensorclass | ||
class cummin: | ||
"""A `cummin` tensorclass to be used as a result for :meth:`~tensordict.TensorDict.cummin` operations.""" | ||
|
||
vals: TensorDict | ||
indices: TensorDict | ||
|
||
|
||
@tensorclass | ||
class cummax: | ||
"""A `cummax` tensorclass to be used as a result for :meth:`~tensordict.TensorDict.cummax` operations.""" | ||
|
||
vals: TensorDict | ||
indices: TensorDict |
Oops, something went wrong.