def __print_nd__(self, nd: mx.nd.array, label: str): intro = "%s %s - shape %s" % (label, self.print_name, str(nd.shape)) if self.use_logger: logger.info(intro) logger.info(str(nd.asnumpy())) else: print(">>>>> ", intro) print(nd.asnumpy())
def encode_mx(obj: mx.nd.array) -> str: """ Encode a mxnet nd-array as a bytestring. Parameters ---------- obj : ``mx.nd.array`` Object to be encoded Returns ------- bytestr : ``str`` bytestring representation of the passed object """ return encode_numpy(obj.asnumpy())