gpflow.experimental.check_shapes.argument_ref¶
Code for (de)referencing arguments.
gpflow.experimental.check_shapes.argument_ref.ArgumentRef¶
- class gpflow.experimental.check_shapes.argument_ref.ArgumentRef[source]¶
Bases:
abc.ABC
A reference to an argument.
- Attributes
is_result
Whether this is a reference to the function result.
root_argument_name
Name of the argument this reference eventually starts from.
Methods
get
(func, arg_map)Get the value of this argument from this given map.
- get(func, arg_map)[source]¶
Get the value of this argument from this given map.
- Parameters
func (
TypeVar
(C
, bound=Callable
[...
,Any
])) –arg_map (
Mapping
[str
,Any
]) –
- Return type
Any
- abstract property is_result: bool¶
Whether this is a reference to the function result.
- Return type
bool
- abstract property root_argument_name: str¶
Name of the argument this reference eventually starts from.
Returns RESULT_TOKEN if this in an argument to the function result.
- Return type
str
gpflow.experimental.check_shapes.argument_ref.AttributeArgumentRef¶
- class gpflow.experimental.check_shapes.argument_ref.AttributeArgumentRef(source, attribute_name)[source]¶
Bases:
gpflow.experimental.check_shapes.argument_ref.ArgumentRef
A reference to an attribute on an argument.
- Attributes
is_result
Whether this is a reference to the function result.
root_argument_name
Name of the argument this reference eventually starts from.
Methods
get
(func, arg_map)Get the value of this argument from this given map.
- Parameters
source (
ArgumentRef
) –attribute_name (
str
) –
- property is_result: bool¶
Whether this is a reference to the function result.
- Return type
bool
- property root_argument_name: str¶
Name of the argument this reference eventually starts from.
Returns RESULT_TOKEN if this in an argument to the function result.
- Return type
str
gpflow.experimental.check_shapes.argument_ref.IndexArgumentRef¶
- class gpflow.experimental.check_shapes.argument_ref.IndexArgumentRef(source, index)[source]¶
Bases:
gpflow.experimental.check_shapes.argument_ref.ArgumentRef
A reference to an element in a list.
- Attributes
is_result
Whether this is a reference to the function result.
root_argument_name
Name of the argument this reference eventually starts from.
Methods
get
(func, arg_map)Get the value of this argument from this given map.
- Parameters
source (
ArgumentRef
) –index (
int
) –
- property is_result: bool¶
Whether this is a reference to the function result.
- Return type
bool
- property root_argument_name: str¶
Name of the argument this reference eventually starts from.
Returns RESULT_TOKEN if this in an argument to the function result.
- Return type
str
gpflow.experimental.check_shapes.argument_ref.RootArgumentRef¶
- class gpflow.experimental.check_shapes.argument_ref.RootArgumentRef(argument_name)[source]¶
Bases:
gpflow.experimental.check_shapes.argument_ref.ArgumentRef
A reference to a single argument.
- Attributes
is_result
Whether this is a reference to the function result.
root_argument_name
Name of the argument this reference eventually starts from.
Methods
get
(func, arg_map)Get the value of this argument from this given map.
- Parameters
argument_name (
str
) –
- property is_result: bool¶
Whether this is a reference to the function result.
- Return type
bool
- property root_argument_name: str¶
Name of the argument this reference eventually starts from.
Returns RESULT_TOKEN if this in an argument to the function result.
- Return type
str