I’m confused, though. Why are you using TF and PyTorch? Best to stick with one for a single experiment to avoid any conflicts. Generally speaking, using torch, this should make your code reproducible.
seed = 42
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
np.random.seed(seed)
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)