95b514506001427defabbcc4ba9fba888932b605,t3f/initializers.py,,tensor_ones,#Any#,8
Before Change
num_dims = shape.size
tt_rank = np.ones(num_dims + 1)
shape = shape.astype(int)
tt_cores = num_dims * [None]
for i in range(num_dims):
curr_core_shape = (1, shape[i], 1)
tt_cores[i] = tf.ones(curr_core_shape)
return TensorTrain(tt_cores, shape, tt_rank)
After Change
raise ValueError("shape should be 1d array")
if np.any(shape < 1):
raise ValueError("all elements in `shape` should be positive")
if not all(isinstance(sh, np.integer) for sh in shape):
raise ValueError("all elements in `shape` should be integers")
num_dims = shape.size
tt_rank = np.ones(num_dims + 1)
tt_cores = num_dims * [None]
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 14
Instances
Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: tensor_ones
Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: matrix_ones
Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: eye
Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: matrix_zeros
Project Name: Bihaqo/t3f
Commit Name: 95b514506001427defabbcc4ba9fba888932b605
Time: 2017-12-26
Author: khrulkov.v@gmail.com
File Name: t3f/initializers.py
Class Name:
Method Name: tensor_zeros