Commit 183c9dd 1 parent 4f10031 commit 183c9dd Copy full SHA for 183c9dd
File tree 2 files changed +10
-1
lines changed
docs/source/package_reference
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ These are basic dataclasses used throughout 🤗 Accelerate and they can be pass
50
50
51
51
[[ autodoc]] utils.ProjectConfiguration
52
52
53
+ ## Environmental Variables
54
+
55
+ These are environmental variables that can be enabled for different use cases
56
+
57
+ * ` ACCELERATE_DEBUG_MODE ` (` str ` ): Whether to run accelerate in debug mode. More info available [ here] ( ../usage_guides/debug.md ) .
58
+
53
59
## Plugins
54
60
55
61
These are plugins that can be passed to the [ ` Accelerator ` ] object. While they are defined elsewhere in the documentation,
Original file line number Diff line number Diff line change @@ -78,12 +78,15 @@ class SeedableRandomSampler(RandomSampler):
78
78
def __init__ (self , * args , ** kwargs ):
79
79
super ().__init__ (* args , ** kwargs )
80
80
self .epoch = 0
81
+ self .seed = torch .random .initial_seed ()
81
82
82
83
def __iter__ (self ):
83
84
if self .generator is None :
84
85
self .generator = torch .Generator ()
86
+ else :
87
+ self .seed = self .generator .initial_seed ()
85
88
# Allow `self.epoch` to modify the seed of the generator
86
- seed = self .epoch + self .generator . initial_seed ()
89
+ seed = self .epoch + self .seed
87
90
self .generator .manual_seed (seed )
88
91
yield from super ().__iter__ ()
89
92
self .set_epoch (self .epoch + 1 )
You can’t perform that action at this time.
0 commit comments