@@ -180,6 +180,21 @@ def __init__(self, data, span=None):
180180 self .__init_handle_by_constructor__ (_ffi_api .Constant , data , span )
181181
182182
183+ @tvm ._ffi .register_func ("relay.ConstantWithFields" )
184+ def ConstantWithFields (
185+ constant ,
186+ data = None ,
187+ virtual_device = None ,
188+ span = None ,
189+ ):
190+ """
191+ Returns constant with the given properties. A None property denotes 'no change'.
192+ Returns constant if all properties are unchanged. Otherwise, returns a copy with the new
193+ fields.
194+ """
195+ return _ffi_api .ConstantWithFields (constant , data , virtual_device , span )
196+
197+
183198@tvm ._ffi .register_object ("relay.Tuple" )
184199class Tuple (ExprWithOp ):
185200 """Tuple expression that groups several fields together.
@@ -208,6 +223,16 @@ def astype(self, _):
208223 raise TypeError ("astype cannot be used on tuple" )
209224
210225
226+ @tvm ._ffi .register_func ("relay.TupleWithFields" )
227+ def TupleWithFields (tup , fields = None , virtual_device = None , span = None ):
228+ """
229+ Returns tuple with the given properties. A None property denotes 'no change'.
230+ Returns tuple if all properties are unchanged. Otherwise, returns a copy with the new
231+ fields.
232+ """
233+ return _ffi_api .TupleWithFields (tup , fields , virtual_device , span )
234+
235+
211236@tvm ._ffi .register_object ("relay.Var" )
212237class Var (ExprWithOp ):
213238 """A local variable in Relay.
@@ -239,6 +264,16 @@ def name_hint(self):
239264 return name
240265
241266
267+ @tvm ._ffi .register_func ("relay.VarWithFields" )
268+ def VarWithFields (variable , vid = None , type_annotation = None , virtual_device = None , span = None ):
269+ """
270+ Returns var with the given properties. A None property denotes 'no change'.
271+ Returns var if all properties are unchanged. Otherwise, returns a copy with the new
272+ fields.
273+ """
274+ return _ffi_api .VarWithFields (variable , vid , type_annotation , virtual_device , span )
275+
276+
242277@tvm ._ffi .register_object ("relay.Call" )
243278class Call (ExprWithOp ):
244279 """Function call node in Relay.
@@ -271,6 +306,18 @@ def __init__(self, op, args, attrs=None, type_args=None, span=None):
271306 self .__init_handle_by_constructor__ (_ffi_api .Call , op , args , attrs , type_args , span )
272307
273308
309+ @tvm ._ffi .register_func ("relay.CallWithFields" )
310+ def CallWithFields (
311+ call , op = None , args = None , attrs = None , type_args = None , virtual_device = None , span = None
312+ ):
313+ """
314+ Returns call with the given properties. A None property denotes 'no change'.
315+ Returns call if all properties are unchanged. Otherwise, returns a copy with the new
316+ fields.
317+ """
318+ return _ffi_api .CallWithFields (call , op , args , attrs , type_args , virtual_device , span )
319+
320+
274321@tvm ._ffi .register_object ("relay.Let" )
275322class Let (ExprWithOp ):
276323 """Let variable binding expression.
@@ -294,6 +341,16 @@ def __init__(self, variable, value, body, span=None):
294341 self .__init_handle_by_constructor__ (_ffi_api .Let , variable , value , body , span )
295342
296343
344+ @tvm ._ffi .register_func ("relay.LetWithFields" )
345+ def LetWithFields (let , variable = None , value = None , body = None , virtual_device = None , span = None ):
346+ """
347+ Returns let with the given properties. A None property denotes 'no change'.
348+ Returns let if all properties are unchanged. Otherwise, returns a copy with the new
349+ fields.
350+ """
351+ return _ffi_api .LetWithFields (let , variable , value , body , virtual_device , span )
352+
353+
297354@tvm ._ffi .register_object ("relay.If" )
298355class If (ExprWithOp ):
299356 """A conditional expression in Relay.
@@ -317,6 +374,18 @@ def __init__(self, cond, true_branch, false_branch, span=None):
317374 self .__init_handle_by_constructor__ (_ffi_api .If , cond , true_branch , false_branch , span )
318375
319376
377+ @tvm ._ffi .register_func ("relay.IfWithFields" )
378+ def IfWithFields (
379+ if_expr , cond = None , true_branch = None , false_branch = None , virtual_device = None , span = None
380+ ):
381+ """
382+ Returns if with the given properties. A None property denotes 'no change'.
383+ Returns if if all properties are unchanged. Otherwise, returns a copy with the new
384+ fields.
385+ """
386+ return _ffi_api .IfWithFields (if_expr , cond , true_branch , false_branch , virtual_device , span )
387+
388+
320389@tvm ._ffi .register_object ("relay.TupleGetItem" )
321390class TupleGetItem (ExprWithOp ):
322391 """Get index-th item from a tuple.
@@ -337,6 +406,18 @@ def __init__(self, tuple_value, index, span=None):
337406 self .__init_handle_by_constructor__ (_ffi_api .TupleGetItem , tuple_value , index , span )
338407
339408
409+ @tvm ._ffi .register_func ("relay.TupleGetItemWithFields" )
410+ def TupleGetItemWithFields (
411+ tuple_get_item , tuple_value = None , index = None , virtual_device = None , span = None
412+ ):
413+ """
414+ Returns tuple_get_item with the given properties. A None property denotes 'no change'.
415+ Returns tuple_get_item if all properties are unchanged. Otherwise, returns a copy with the new
416+ fields.
417+ """
418+ return _ffi_api .TupleGetItemWithFields (tuple_get_item , tuple_value , index , virtual_device , span )
419+
420+
340421@tvm ._ffi .register_object ("relay.RefCreate" )
341422class RefCreate (ExprWithOp ):
342423 """Create a new reference from initial value.
@@ -353,6 +434,21 @@ def __init__(self, value, span=None):
353434 self .__init_handle_by_constructor__ (_ffi_api .RefCreate , value , span )
354435
355436
437+ @tvm ._ffi .register_func ("relay.RefCreateWithFields" )
438+ def RefCreateWithFields (
439+ ref_create ,
440+ value = None ,
441+ virtual_device = None ,
442+ span = None ,
443+ ):
444+ """
445+ Returns ref_create with the given properties. A None property denotes 'no change'.
446+ Returns ref_create if all properties are unchanged. Otherwise, returns a copy with the new
447+ fields.
448+ """
449+ return _ffi_api .RefCreateWithFields (ref_create , value , virtual_device , span )
450+
451+
356452@tvm ._ffi .register_object ("relay.RefRead" )
357453class RefRead (ExprWithOp ):
358454 """Get the value inside the reference.
@@ -369,6 +465,21 @@ def __init__(self, ref, span=None):
369465 self .__init_handle_by_constructor__ (_ffi_api .RefRead , ref , span )
370466
371467
468+ @tvm ._ffi .register_func ("relay.RefReadWithFields" )
469+ def RefReadWithFields (
470+ ref_read ,
471+ ref = None ,
472+ virtual_device = None ,
473+ span = None ,
474+ ):
475+ """
476+ Returns ref_read with the given properties. A None property denotes 'no change'.
477+ Returns ref_read if all properties are unchanged. Otherwise, returns a copy with the new
478+ fields.
479+ """
480+ return _ffi_api .RefReadWithFields (ref_read , ref , virtual_device , span )
481+
482+
372483@tvm ._ffi .register_object ("relay.RefWrite" )
373484class RefWrite (ExprWithOp ):
374485 """
@@ -390,6 +501,22 @@ def __init__(self, ref, value, span=None):
390501 self .__init_handle_by_constructor__ (_ffi_api .RefWrite , ref , value , span )
391502
392503
504+ @tvm ._ffi .register_func ("relay.RefWriteWithFields" )
505+ def RefWriteWithFields (
506+ ref_write ,
507+ ref = None ,
508+ value = None ,
509+ virtual_device = None ,
510+ span = None ,
511+ ):
512+ """
513+ Returns ref_write with the given properties. A None property denotes 'no change'.
514+ Returns ref_write if all properties are unchanged. Otherwise, returns a copy with the new
515+ fields.
516+ """
517+ return _ffi_api .RefWriteWithFields (ref_write , ref , value , virtual_device , span )
518+
519+
393520class TempExpr (ExprWithOp ):
394521 """Baseclass of all TempExpr.
395522
0 commit comments