330154d9f5344f0a6ab39b3a313626c4b574dbbd,kronecker.py,,inv,#Any#,90

Before Change


  inv_cores = []
  for core_idx in range(kron_a.ndims()):
    core = kron_a.tt_cores[core_idx]
    if core.get_shape()[1] != core.get_shape()[2]:
      raise ValueError("The argument should be a Kronecker product of square"
                      "matrices (tt-cores must be square)")
 
    core_inv = tf.matrix_inverse(core[0, :, :, 0])
    inv_cores.append(tf.expand_dims(tf.expand_dims(core_inv, 0), -1))

  res_ranks = tf.TensorShape([1] * (kron_a.ndims() + 1))

After Change


    raise ValueError("The argument should be a Kronecker product " 
                     "(tt-ranks should be 1)")
    
  shapes_defined = kron_a.get_shape().is_fully_defined()
  if shapes_defined:
    i_shapes = kron_a.get_raw_shape()[0]
    j_shapes = kron_a.get_raw_shape()[1]
  else:
    i_shapes = raw_shape(kron_a)[0]

  if shapes_defined:
    if i_shapes != j_shapes:
      raise ValueError("The argument should be a Kronecker product of square "
                       "matrices (tt-cores must be square)")

  inv_cores = []
  for core_idx in range(kron_a.ndims()):
    core = kron_a.tt_cores[core_idx]
    core_inv = tf.matrix_inverse(core[0, :, :, 0])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 23

Instances


Project Name: Bihaqo/t3f
Commit Name: 330154d9f5344f0a6ab39b3a313626c4b574dbbd
Time: 2017-02-11
Author: izmailovpavel@gmail.com
File Name: kronecker.py
Class Name:
Method Name: inv


Project Name: Bihaqo/t3f
Commit Name: 330154d9f5344f0a6ab39b3a313626c4b574dbbd
Time: 2017-02-11
Author: izmailovpavel@gmail.com
File Name: kronecker.py
Class Name:
Method Name: cholesky


Project Name: Bihaqo/t3f
Commit Name: 330154d9f5344f0a6ab39b3a313626c4b574dbbd
Time: 2017-02-11
Author: izmailovpavel@gmail.com
File Name: kronecker.py
Class Name:
Method Name: inv


Project Name: Bihaqo/t3f
Commit Name: 40db92599e7607b97f5b52a4d6a90bef9612c317
Time: 2017-02-11
Author: izmailovpavel@gmail.com
File Name: kronecker.py
Class Name:
Method Name: slog_determinant