094d40234092f583f55b1d025b9424d2a1b20b43,kymatio/scattering2d/frontend/tensorflow_frontend.py,ScatteringTensorFlow2D,scattering,#ScatteringTensorFlow2D#,16

Before Change


            if not self.out_type in ("array", "list"):
                raise RuntimeError("The out_type must be one of "array" or "list".")

            batch_shape = tuple(input.shape[:-2])
            signal_shape = tuple(input.shape[-2:])

            input = tf.reshape(input, (-1,) + signal_shape)

            S = scattering2d(input, self.pad, self.unpad, self.backend, self.J, self.L, self.phi, self.psi,
                             self.max_order, self.out_type)

            if self.out_type == "array":
                scattering_shape = tuple(S.shape[-3:])
                new_shape = batch_shape + scattering_shape

                S = tf.reshape(S, new_shape)
            else:
                scattering_shape = tuple(S[0]["coef"].shape[-2:])

After Change



            // Use tf.shape to get the dynamic shape of the tf.Tensors at
            // execution time.
            batch_shape = tf.shape(input)[:-2]
            signal_shape = tf.shape(input)[-2:]

            // NOTE: Cannot simply concatenate these using + since they are
            // tf.Tensors and that would add their values.
            input = tf.reshape(input, tf.concat(((-1,), signal_shape), 0))

            S = scattering2d(input, self.pad, self.unpad, self.backend, self.J, self.L, self.phi, self.psi,
                             self.max_order, self.out_type)

            if self.out_type == "array":
                scattering_shape = tf.shape(S)[-3:]
                new_shape = tf.concat((batch_shape, scattering_shape), 0)

                S = tf.reshape(S, new_shape)
            else:
                scattering_shape = tf.shape(S[0]["coef"])[-2:]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 22

Instances


Project Name: kymatio/kymatio
Commit Name: 094d40234092f583f55b1d025b9424d2a1b20b43
Time: 2020-02-18
Author: janden@flatironinstitute.org
File Name: kymatio/scattering2d/frontend/tensorflow_frontend.py
Class Name: ScatteringTensorFlow2D
Method Name: scattering


Project Name: kymatio/kymatio
Commit Name: 094d40234092f583f55b1d025b9424d2a1b20b43
Time: 2020-02-18
Author: janden@flatironinstitute.org
File Name: kymatio/scattering2d/frontend/tensorflow_frontend.py
Class Name: ScatteringTensorFlow2D
Method Name: scattering


Project Name: kymatio/kymatio
Commit Name: 0a3be9613457da5efeaa88fc198c8f01666425df
Time: 2020-02-18
Author: janden@flatironinstitute.org
File Name: kymatio/scattering3d/frontend/tensorflow_frontend.py
Class Name: HarmonicScatteringTensorFlow3D
Method Name: scattering


Project Name: kymatio/kymatio
Commit Name: b5453ae0c6700e0d9e12de02876f6a07c58b45ec
Time: 2020-02-18
Author: epnevmatikakis@gmail.com
File Name: kymatio/scattering1d/frontend/tensorflow_frontend.py
Class Name: ScatteringTensorFlow1D
Method Name: scattering