2a3a5d3cef42e5bf997cfb9dac87163ccaa3c8f1,sonnet/src/utils.py,,format_variables,#Any#Any#,219

Before Change


  rows.append(("Variable", "Shape", "Type", "Trainable", "Device"))
  for var in sorted(variables, key=lambda var: var.name):
    name = var.name.split(":")[0]  // Remove the ":0" suffix.
    shape = "x".join(str(dim) for dim in var.shape)
    dtype = repr(var.dtype).replace("tf.", "")
    trainable = str(var.trainable)
    device = str(var.device) if var.device else ""
    rows.append((name, shape, dtype, trainable, device))

After Change


  rows = []
  header = ("Variable", "Spec", "Trainable", "Device")
  rows.append(header)
  rows.append(tuple("=" * len(c) for c in header))
  for var in sorted(variables, key=_name_scope_then_rank):
    name = var.name.split(":")[0]  // Remove the ":0" suffix.
    spec = _render_spec(var.shape, var.dtype)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: deepmind/sonnet
Commit Name: 2a3a5d3cef42e5bf997cfb9dac87163ccaa3c8f1
Time: 2019-09-16
Author: tomhennigan@google.com
File Name: sonnet/src/utils.py
Class Name:
Method Name: format_variables


Project Name: keras-team/keras
Commit Name: bf464d7ed9283988fea1f548a11a0171fd2ff364
Time: 2021-01-06
Author: gardener@tensorflow.org
File Name: keras/utils/version_utils.py
Class Name:
Method Name: swap_class


Project Name: NifTK/NiftyNet
Commit Name: bbf4350363dc25cb9cdabb9d8fb635e96a617f32
Time: 2017-08-28
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/io/image_type.py
Class Name: SpatialImage3D
Method Name: shape