Ejemplo n.º 1
0
def make_output(name, data):
    if name == "stdout":
        otype = wandb_internal_pb2.OutputRecord.OutputType.STDOUT
    elif name == "stderr":
        otype = wandb_internal_pb2.OutputRecord.OutputType.STDERR
    else:
        # TODO(jhr): throw error?
        print("unknown type")
    outdata = wandb_internal_pb2.OutputRecord(output_type=otype, line=data)
    outdata.timestamp.GetCurrentTime()
    return outdata
Ejemplo n.º 2
0
 def publish_output(self, name, data):
     # from vendor.protobuf import google3.protobuf.timestamp
     # ts = timestamp.Timestamp()
     # ts.GetCurrentTime()
     # now = datetime.now()
     if name == "stdout":
         otype = wandb_internal_pb2.OutputRecord.OutputType.STDOUT
     elif name == "stderr":
         otype = wandb_internal_pb2.OutputRecord.OutputType.STDERR
     else:
         # TODO(jhr): throw error?
         print("unknown type")
     o = wandb_internal_pb2.OutputRecord(output_type=otype, line=data)
     o.timestamp.GetCurrentTime()
     self._publish_output(o)