Example #1
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         physical_out_blob_objects = builder.UnpackLogicalBlobToPhysicalBlobs(
             GetInBlobObject(builder, "in", bn_in_op2blob_object))
         for i, blob_object in enumerate(physical_out_blob_objects):
             bn_in_op2blob_object["out_%s" % i] = blob_object
Example #2
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         builder.StatefulCall(
             op_attribute,
             opkernel_object=opkernel_object,
             bn_in_op2blob_object=bn_in_op2blob_object,
         )
Example #3
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         builder.StatelessCall(
             op_attribute,
             parallel_conf,
             bn_in_op2blob_object=bn_in_op2blob_object,
         )
Example #4
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         in_blob_object = bn_in_op2blob_object["in"]
         parallel_desc_symbol = in_blob_object.parallel_desc_symbol
         op_arg_parallel_attr = oneflow_api.GetOpArgParallelAttribute(
             parallel_desc_symbol, str(op_attribute), "out")
         out_blob_object = builder.MakeReferenceBlobObject(
             in_blob_object, op_arg_parallel_attr)
         bn_in_op2blob_object["out"] = out_blob_object
Example #5
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         cfg_op_attribute = oneflow_api.deprecated.MakeOpAttributeByString(
             str(op_attribute))
         builder.StatefulCall(
             cfg_op_attribute,
             opkernel_object,
             bn_in_op2blob_object,
             boxing_util.BoxingTo,
         )
Example #6
0
 def BuildInstruction(builder):
     with blob_register_util.BnInOp2BlobObjectScope(
             blob_register, op_attribute) as bn_in_op2blob_object:
         cfg_op_attribute = oneflow._oneflow_internal.deprecated.MakeOpAttributeByString(
             str(op_attribute))
         builder.StatelessCall(
             cfg_op_attribute,
             parallel_conf,
             bn_in_op2blob_object,
             boxing_util.BoxingTo,
         )
Example #7
0
    def BuildInstruction(builder):
        with blob_register_util.BnInOp2BlobObjectScope(
            blob_register, op_attribute
        ) as bn_in_op2blob_object:

            def GetPhysicalInBlob(i):
                return GetInBlobObject(builder, i, bn_in_op2blob_object)

            in_blob_objects = [GetPhysicalInBlob(i) for i in range(parallel_size)]
            bn_in_op2blob_object["out"] = builder.PackPhysicalBlobsToLogicalBlob(
                in_blob_objects, op_arg_parallel_attr, op_arg_blob_attr
            )