From 11ae4cc3d32d0f82cd15100f5f124a25c8a0a1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danie=CC=88l=20de=20Kok?= Date: Thu, 9 Jun 2022 14:46:13 +0200 Subject: [PATCH] Remove last vestiges of PrecomputableAffine This does not exist anymore as a separate layer. --- spacy/ml/_precomputable_affine.py | 2 -- spacy/tests/test_misc.py | 29 ----------------------------- 2 files changed, 31 deletions(-) delete mode 100644 spacy/ml/_precomputable_affine.py diff --git a/spacy/ml/_precomputable_affine.py b/spacy/ml/_precomputable_affine.py deleted file mode 100644 index ada04b26a..000000000 --- a/spacy/ml/_precomputable_affine.py +++ /dev/null @@ -1,2 +0,0 @@ -class PrecomputableAffine: - pass diff --git a/spacy/tests/test_misc.py b/spacy/tests/test_misc.py index 7374b827a..8e9c80ae6 100644 --- a/spacy/tests/test_misc.py +++ b/spacy/tests/test_misc.py @@ -78,35 +78,6 @@ def test_util_get_package_path(package): assert isinstance(path, Path) -# @pytest.mark.skip(reason="No precomputable affine") -# def test_PrecomputableAffine(nO=4, nI=5, nF=3, nP=2): -# model = PrecomputableAffine(nO=nO, nI=nI, nF=nF, nP=nP).initialize() -# assert model.get_param("W").shape == (nF, nO, nP, nI) -# tensor = model.ops.alloc((10, nI)) -# Y, get_dX = model.begin_update(tensor) -# assert Y.shape == (tensor.shape[0] + 1, nF, nO, nP) -# dY = model.ops.alloc((15, nO, nP)) -# ids = model.ops.alloc((15, nF)) -# ids[1, 2] = -1 -# dY[1] = 1 -# assert not model.has_grad("pad") -# d_pad = _backprop_precomputable_affine_padding(model, dY, ids) -# assert d_pad[0, 2, 0, 0] == 1.0 -# ids.fill(0.0) -# dY.fill(0.0) -# dY[0] = 0 -# ids[1, 2] = 0 -# ids[1, 1] = -1 -# ids[1, 0] = -1 -# dY[1] = 1 -# ids[2, 0] = -1 -# dY[2] = 5 -# d_pad = _backprop_precomputable_affine_padding(model, dY, ids) -# assert d_pad[0, 0, 0, 0] == 6 -# assert d_pad[0, 1, 0, 0] == 1 -# assert d_pad[0, 2, 0, 0] == 0 - - def test_prefer_gpu(): current_ops = get_current_ops() try: