コード例 #1
0
 def to_proto(self):
     """Returns a SaveSliceInfoDef() proto."""
     save_slice_info_def = variable_pb2.SaveSliceInfoDef()
     save_slice_info_def.full_name = self.full_name
     for i in self.full_shape:
         save_slice_info_def.full_shape.append(i)
     for i in self.var_offset:
         save_slice_info_def.var_offset.append(i)
     for i in self.var_shape:
         save_slice_info_def.var_shape.append(i)
     return save_slice_info_def
コード例 #2
0
ファイル: variables.py プロジェクト: yw774/tensorflow
        def to_proto(self, export_scope=None):
            """Returns a SaveSliceInfoDef() proto.

      Args:
        export_scope: Optional `string`. Name scope to remove.

      Returns:
        A `SaveSliceInfoDef` protocol buffer, or None if the `Variable` is not
        in the specified name scope.
      """
            if (export_scope is None
                    or self.full_name.startswith(export_scope)):
                save_slice_info_def = variable_pb2.SaveSliceInfoDef()
                save_slice_info_def.full_name = ops.strip_name_scope(
                    self.full_name, export_scope)
                for i in self.full_shape:
                    save_slice_info_def.full_shape.append(i)
                for i in self.var_offset:
                    save_slice_info_def.var_offset.append(i)
                for i in self.var_shape:
                    save_slice_info_def.var_shape.append(i)
                return save_slice_info_def
            else:
                return None
コード例 #3
0
 def to_proto(self, export_scope=None):
   if (export_scope is None or
       self.full_name.startswith(export_scope)):
     save_slice_info_def = variable_pb2.SaveSliceInfoDef()