File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed
tensorflow_recommenders/layers/feature_interaction Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -122,12 +122,6 @@ def build(self, input_shape):
122
122
use_bias = self ._use_bias ,
123
123
)
124
124
else :
125
- if self ._projection_dim < 0 or self ._projection_dim > last_dim / 2 :
126
- raise ValueError (
127
- "`projection_dim` should be smaller than last_dim / 2 to improve "
128
- "the model efficiency, and should be positive. Got "
129
- "`projection_dim` {}, and last dimension of input {}" .format (
130
- self ._projection_dim , last_dim ))
131
125
self ._dense_u = tf .keras .layers .Dense (
132
126
self ._projection_dim ,
133
127
kernel_initializer = self ._kernel_initializer ,
Original file line number Diff line number Diff line change @@ -49,14 +49,6 @@ def test_one_input(self):
49
49
self .evaluate (tf .compat .v1 .global_variables_initializer ())
50
50
self .assertAllClose (np .asarray ([[0.16 , 0.32 , 0.48 ]]), output )
51
51
52
- def test_invalid_proj_dim (self ):
53
- with self .assertRaisesRegexp (ValueError ,
54
- r"should be smaller than last_dim / 2" ):
55
- x0 = np .random .random ((12 , 5 ))
56
- x = np .random .random ((12 , 5 ))
57
- layer = Cross (projection_dim = 6 )
58
- layer (x0 , x )
59
-
60
52
def test_unsupported_input_dim (self ):
61
53
with self .assertRaisesRegexp (ValueError ,
62
54
r"dimension mismatch" ):
Original file line number Diff line number Diff line change @@ -10,9 +10,14 @@ function create_virtualenv() {
10
10
mkdir -p ~ /virtualenv
11
11
pushd ~ /virtualenv
12
12
rm -rf $env_name
13
- virtualenv -p $env_python $env_name
13
+ virtualenv --no-pip - p $env_python $env_name
14
14
source $env_name /bin/activate
15
- pip install --upgrade pip
15
+ # Keep using an old version of pip to work around
16
+ # https://github.com/pypa/pip/blob/6d636902d7712f77abdb4428c290ba9bdbe70d9c/news/9831.bugfix.rst
17
+ python -m ensurepip
18
+ python -m pip install -U pip==21.0.1
19
+ pip install " pip==21.0.1"
20
+ pip --version
16
21
popd
17
22
}
18
23
You can’t perform that action at this time.
0 commit comments