def JobBuildAndInferCtx_GetStaticShape(job_name, lbn): job_name = str(job_name) lbn = str(lbn) axis_str = oneflow._oneflow_internal.JobBuildAndInferCtx_GetSerializedIdListAsStaticShape( job_name, lbn) int_list = text_format.Parse(axis_str, record_util.Int64List()) return tuple(map(int, int_list.value))
def JobBuildAndInferCtx_MirroredBlobGetStaticShape(job_name, lbn): job_name = str(job_name) lbn = str(lbn) get_shape = ( oneflow_api. JobBuildAndInferCtx_MirroredBlobGetSerializedIdListAsStaticShape) axis_str = get_shape(job_name, lbn) int_list = text_format.Parse(axis_str, record_util.Int64List()) return tuple(map(int, int_list.value))
def JobBuildAndInferCtx_MirroredBlobGetStaticShape(job_name, lbn): job_name = str(job_name) lbn = str(lbn) get_shape = ( oneflow_internal. JobBuildAndInferCtx_MirroredBlobGetSerializedIdListAsStaticShape) axis_str, error_str = get_shape(job_name, lbn) error = text_format.Parse(error_str, error_util.ErrorProto()) if error.HasField("error_type"): raise JobBuildAndInferError(error) int_list = text_format.Parse(axis_str, record_util.Int64List()) return tuple(map(int, int_list.value))
def OneFlow_int64_feature(value): """Generate OFRecord int64 Feature Args: value ([type]): Input 1D int Array Returns: [type]: OFRecord int64 Feature """ if not isinstance(value, (list, tuple)): value = [value] return ofrecord.Feature(int64_list=ofrecord.Int64List(value=value))
def JobBuildAndInferCtx_GetStaticShape(job_name, lbn): job_name = str(job_name) lbn = str(lbn) ( axis_str, error, ) = oneflow_api.JobBuildAndInferCtx_GetSerializedIdListAsStaticShape( job_name, lbn) if error.has_error_type(): raise JobBuildAndInferCfgError(error) int_list = text_format.Parse(axis_str, record_util.Int64List()) return tuple(map(int, int_list.value))
def int64_feature(value): if not isinstance(value, (list, tuple)): value = [value] return ofrecord.Feature(int64_list=ofrecord.Int64List(value=value))