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: 5

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: OpenNMT/OpenNMT-py
Commit Name: 68fbfd1876c367323acf830736bae1af499cc0fe
Time: 2018-03-07
Author: dengyuntian@gmail.com
File Name: onmt/io/TextDataset.py
Class Name: TextDataset
Method Name: __init__


Project Name: OpenNMT/OpenNMT-py
Commit Name: 0b2fd0f6ac45feda4eb2ccd92cc7b15b279a448a
Time: 2017-08-10
Author: benzurdopeters@gmail.com
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: __init__