mirror of https://github.com/llvm/torch-mlir
Remove use of namedtupled defaults kwarg.
* It is incompatible with python < 3.7. Fixes #6pull/8/head
parent
3efbbe8735
commit
186dfd39ea
|
@ -17,16 +17,16 @@ class TraceValueType(Enum):
|
||||||
NDARRAY = 1
|
NDARRAY = 1
|
||||||
|
|
||||||
|
|
||||||
class TraceValue(
|
class TraceValue(namedtuple("TraceValue", ["value", "type"])):
|
||||||
namedtuple("TraceValue", ["value", "type"],
|
|
||||||
defaults=(TraceValueType.NDARRAY,))):
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
"""A Python value and the trace type that it should correspond to."""
|
"""A Python value and the trace type that it should correspond to."""
|
||||||
|
|
||||||
|
|
||||||
|
TraceValue.__new__.__defaults__ = (TraceValueType.NDARRAY,)
|
||||||
|
|
||||||
|
|
||||||
class TraceInvocation(
|
class TraceInvocation(
|
||||||
namedtuple("TraceInvocation", ["inputs", "kwargs", "protocol", "method"],
|
namedtuple("TraceInvocation", ["inputs", "kwargs", "protocol", "method"])):
|
||||||
defaults=(Protocol.ARRAY_FUNC, "__call__"))):
|
|
||||||
"""An invocation of a single functions.
|
"""An invocation of a single functions.
|
||||||
|
|
||||||
This abstracts over both ufuncs and array_funcs, differentiating by the
|
This abstracts over both ufuncs and array_funcs, differentiating by the
|
||||||
|
@ -35,10 +35,12 @@ class TraceInvocation(
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
|
|
||||||
|
TraceInvocation.__new__.__defaults__ = (Protocol.ARRAY_FUNC, "__call__")
|
||||||
|
|
||||||
|
|
||||||
class EmissionRequest(
|
class EmissionRequest(
|
||||||
namedtuple("EmissionRequest",
|
namedtuple("EmissionRequest",
|
||||||
["input_ssa_values", "dialect_helper", "extra"],
|
["input_ssa_values", "dialect_helper", "extra"])):
|
||||||
defaults=(None,))):
|
|
||||||
"""Represents the result of processing inputs from an invocation.
|
"""Represents the result of processing inputs from an invocation.
|
||||||
|
|
||||||
The `input_ssa_values` are mlir.ir.Value instances corresponding to
|
The `input_ssa_values` are mlir.ir.Value instances corresponding to
|
||||||
|
@ -53,10 +55,12 @@ class EmissionRequest(
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
|
|
||||||
|
EmissionRequest.__new__.__defaults__ = (None,)
|
||||||
|
|
||||||
|
|
||||||
class TraceValueMap(
|
class TraceValueMap(
|
||||||
namedtuple("TraceValueMap",
|
namedtuple("TraceValueMap",
|
||||||
["input_trace_values", "result_trace_value_types", "extra"],
|
["input_trace_values", "result_trace_value_types", "extra"])):
|
||||||
defaults=(None,))):
|
|
||||||
"""The result of mapping an invocation to corresponding op structure.
|
"""The result of mapping an invocation to corresponding op structure.
|
||||||
|
|
||||||
This type associates:
|
This type associates:
|
||||||
|
@ -69,6 +73,9 @@ class TraceValueMap(
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
|
|
||||||
|
TraceValueMap.__new__.__defaults__ = (None)
|
||||||
|
|
||||||
|
|
||||||
class FuncEmitter:
|
class FuncEmitter:
|
||||||
"""An emitter for an op-like function invocation."""
|
"""An emitter for an op-like function invocation."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue