MCPcopy Create free account
hub / github.com/apache/tvm / TupleProxy

Class TupleProxy

python/tvm/relax/script/parser/entry.py:373–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371
372
373class TupleProxy(StructInfoProxy):
374 fields: list[StructInfoProxy]
375 """The type of tuple values.
376
377 Parameters
378 ----------
379 fields : List[StructInfoProxy]
380 The fields in the tuple
381 """
382
383 def __init__(
384 self,
385 *fields: list[StructInfoProxy],
386 ) -> None:
387 if len(fields) == 1 and isinstance(fields[0], tuple | list):
388 fields = fields[0]
389 # convert `R.Tensor` to `R.Tensor()`
390 self.fields = [field() if callable(field) else field for field in fields]
391
392 def get_symbolic_vars(self) -> set[str]:
393 return set().union(*[f.get_symbolic_vars() for f in self.fields])
394
395 def as_struct_info(self, dict_globals: dict[str, Any] | None = None) -> TupleStructInfo:
396 fields = [field.as_struct_info(dict_globals) for field in self.fields]
397 return TupleStructInfo(fields)
398
399
400def Tuple(*fields: list[StructInfoProxy]) -> TupleProxy:

Callers 2

TupleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…