compare_tensor_dict_key

Description

Compares the keys specified by two dictionaries.

Prototype

def compare_tensor_dict_key(dict1, dict2, dict_key)

Parameters

Parameter

Description

dict1

Dictionary 1.

dict2

Dictionary 2.

dict_key

Key string.

Returns

None

"RuntimeError" is thrown if the verification fails.

Restrictions

None

Example

from tbe.common.utils import shape_util 
dict1 = {}
dict1.append("key", 1)
dict2 = {}
dict2.append("key", 1)
shape_util.compare_tensor_dict_key(dict1, dict2, "key") 

Checks whether the corresponding keys in dict1 and dict2 have the same value.