be119b0bb043be437f9619c26cf0f9878a6a9090,GPflow/misc.py,,get_tensor_by_name,#Any#Any#Any#,38

Before Change



def get_tensor_by_name(name, index=None, graph=None):
    graph = _get_graph(graph)
    try:
        if index is not None:
            return graph.get_tensor_by_name(":".join([name, index]))
        return graph.get_tensor_by_name(name)
    except ValueError:
        return None


def is_ndarray(value):
    return isinstance(value, np.ndarray)

def is_tensor(value):

After Change


    if index is not None:
        return _get_tensor_by_name(name, index, graph)
    tensor = _get_tensor_by_name(name, "0", graph)
    if tensor is None:
        return tensor
    if _get_tensor_by_name(name, "1", graph) is not None:
        raise ValueError("Ambiguous tensor for "{0}" with multiple indices found."
                         .format(name))
    return tensor


def is_ndarray(value):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: GPflow/GPflow
Commit Name: be119b0bb043be437f9619c26cf0f9878a6a9090
Time: 2017-09-14
Author: art.art.v@gmail.com
File Name: GPflow/misc.py
Class Name:
Method Name: get_tensor_by_name


Project Name: keras-team/keras
Commit Name: c3eb62763fcc5029c26b025ba1b60d7788d491a1
Time: 2019-03-30
Author: andhus@kth.se
File Name: keras/engine/saving.py
Class Name:
Method Name: load_model


Project Name: keras-team/keras
Commit Name: c3eb62763fcc5029c26b025ba1b60d7788d491a1
Time: 2019-03-30
Author: andhus@kth.se
File Name: keras/engine/saving.py
Class Name:
Method Name: save_model