Skip to content

Instantly share code, notes, and snippets.

View SebastienEske's full-sized avatar

Sebastien Eskenazi SebastienEske

View GitHub Profile
@SebastienEske
SebastienEske / pytorch_lightning_ddp_bug_example.py
Created February 18, 2021 07:35
Minimal working example to show bug
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
import random
class CMWC(random.Random):
# code from here https://code.activestate.com/recipes/576707/
'Long period random number generator: Complementary Multiply with Carry'
# http://en.wikipedia.org/wiki/Multiply-with-carry
a = 3636507990
logb = 32