zhengchong's picture
chore: Update dependencies and code structure
6eb1d7d
raw
history blame contribute delete
No virus
375 Bytes
# Copyright (c) Facebook, Inc. and its affiliates.
# pyre-unsafe
from torch import nn
def initialize_module_params(module: nn.Module) -> None:
for name, param in module.named_parameters():
if "bias" in name:
nn.init.constant_(param, 0)
elif "weight" in name:
nn.init.kaiming_normal_(param, mode="fan_out", nonlinearity="relu")