コード例 #1
0
def op_attr_type(op_type, attr_name):
  try:
    return _op_attr_type_cache[(op_type, attr_name)]
  except KeyError:
    context.ensure_initialized()
    h = context.context()._handle  # pylint: disable=protected-access
    attr_type = pywrap_tensorflow.TFE_OpNameGetAttrType(h, op_type, attr_name)
  _op_attr_type_cache[(op_type, attr_name)] = attr_type
  return attr_type
コード例 #2
0
ファイル: backprop.py プロジェクト: zihaolucky/tensorflow
def op_attr_type(op_type, attr_name):
    try:
        return _op_attr_type_cache[(op_type, attr_name)]
    except KeyError:
        with errors.raise_exception_on_not_ok_status() as status:
            h = context.context()._handle  # pylint: disable=protected-access
            attr_type = pywrap_tensorflow.TFE_OpNameGetAttrType(
                h, op_type, attr_name, status)
        _op_attr_type_cache[(op_type, attr_name)] = attr_type
        return attr_type