From 1911520fa08c609f2f519c6caa78db32efe596cf Mon Sep 17 00:00:00 2001 From: Plutonium-239 Date: Mon, 1 Apr 2024 13:09:08 +0530 Subject: [PATCH] minor --- makefile | 2 +- memsave_torch/nn/LayerNorm.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index b14bbf0..702ece3 100644 --- a/makefile +++ b/makefile @@ -31,7 +31,7 @@ ruff: .PHONY: test test-full test: - @pytest -vx --cov=memsave_torch test -m quick + @pytest -vx --cov=memsave_torch/nn test -m quick test-full: @pytest -vx --cov=memsave_torch test diff --git a/memsave_torch/nn/LayerNorm.py b/memsave_torch/nn/LayerNorm.py index 5279064..6a4ac64 100644 --- a/memsave_torch/nn/LayerNorm.py +++ b/memsave_torch/nn/LayerNorm.py @@ -83,6 +83,8 @@ def from_nn_LayerNorm(cls, ln: nn.LayerNorm): f"Trying to load a model saved in torch>=2.1, but system version is {torch_version}. \n" + "This is problematic because torch 2.1 changed how LayerNorm bias works." ) + else: + obj.bias = ln.bias return obj