10 KiB
module concrete.compiler.lambda_argument
LambdaArgument.
Global Variables
- ACCEPTED_INTS
class LambdaArgument
LambdaArgument holds scalar or tensor values.
method __init__
__init__(lambda_argument: LambdaArgument)
Wrap the native Cpp object.
Args:
lambda_argument(_LambdaArgument): object to wrap
Raises:
TypeError: if lambda_argument is not of type _LambdaArgument
method from_scalar
from_scalar(scalar: int) → LambdaArgument
Build a LambdaArgument containing the given scalar value.
Args:
scalar(int or numpy.uint): scalar value to embed in LambdaArgument
Raises:
TypeError: if scalar is not of type int or numpy.uint
Returns: LambdaArgument
method from_signed_scalar
from_signed_scalar(scalar: int) → LambdaArgument
Build a LambdaArgument containing the given scalar value.
Args:
scalar(int or numpy.int): scalar value to embed in LambdaArgument
Raises:
TypeError: if scalar is not of type int or numpy.uint
Returns: LambdaArgument
method from_tensor_i16
from_tensor_i16(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_i32
from_tensor_i32(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_i64
from_tensor_i64(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_i8
from_tensor_i8(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_u16
from_tensor_u16(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_u32
from_tensor_u32(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_u64
from_tensor_u64(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method from_tensor_u8
from_tensor_u8(data: List[int], shape: List[int]) → LambdaArgument
Build a LambdaArgument containing the given tensor.
Args:
data(List[int]): flattened tensor datashape(List[int]): shape of original tensor before flattening
Returns: LambdaArgument
method get_scalar
get_scalar() → int
Return the contained scalar value.
Returns: int
method get_signed_scalar
get_signed_scalar() → int
Return the contained scalar value.
Returns: int
method get_signed_tensor_data
get_signed_tensor_data() → List[int]
Return the contained flattened tensor data.
Returns: List[int]
method get_tensor_data
get_tensor_data() → List[int]
Return the contained flattened tensor data.
Returns: List[int]
method get_tensor_shape
get_tensor_shape() → List[int]
Return the shape of the contained tensor.
Returns:
List[int]: tensor shape
method is_scalar
is_scalar() → bool
Check if the contained argument is a scalar.
Returns: bool
method is_signed
is_signed() → bool
Check if the contained argument is signed.
Returns: bool
method is_tensor
is_tensor() → bool
Check if the contained argument is a tensor.
Returns: bool
method new
new(*args, **kwargs)
Use from_scalar or from_tensor instead.
Raises: RuntimeError