function getUniqueTensorName(scopedName) {
	  if (!isValidTensorName(scopedName)) {
	    throw new Error('Not a valid tensor name: \'' + scopedName + '\'');
	  }

	  if (!nameMap.has(scopedName)) {
	    nameMap.set(scopedName, 0);
	  }

	  var index = nameMap.get(scopedName);
	  nameMap.set(scopedName, nameMap.get(scopedName) + 1);

	  if (index > 0) {
	    var result = scopedName + "_" + index; // Mark the composed name as used in case someone wants
	    // to call getUniqueTensorName("name_1").

	    nameMap.set(result, 1);
	    return result;
	  } else {
	    return scopedName;
	  }
	}
Get unique names for Tensors and Variables.
@param scopedName The fully-qualified name of the Tensor, i.e. as produced by
 `getScopedTensorName()`.
@return A unique version of the given fully scoped name.
  If this is the first time that the scoped name is seen in this session,
  then the given `scopedName` is returned unaltered.  If the same name is
  seen again (producing a collision), an incrementing suffix is added to the
  end of the name, so it takes the form 'scope/name_1', 'scope/name_2', etc.