ddql_optimal_execution.state.State¶
-
class
ddql_optimal_execution.state.
State
[source]¶ -
The class State is a subclass of the built-in dict class. It is used to store the state of the environment.
-
__init__
(*args, **kwargs)¶
Methods
__init__
(*args, **kwargs)clear
()copy
()The function returns a new State object that is a copy of the current State object.
fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised
popitem
()Remove and return a (key, value) pair as a 2-tuple.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
update
([E, ]**F)If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
update_state
(**kwargs)This function updates the state of an object with the key-value pairs passed as keyword arguments.
values
()Attributes
This function converts a dictionary of values into a PyTorch tensor.
-
property
astensor
¶ -
This function converts a dictionary of values into a PyTorch tensor.
- Return type
The function astensor is returning a PyTorch tensor that is created from the values of the
dictionary object that the function is called on. The values are first converted to a list using the values() method, and then the list is converted to a PyTorch tensor using the torch.Tensor() function. Finally, the tensor is cast to a float data type using the `.float
-
copy
() ddql_optimal_execution.state._state.State [source]¶ -
The function returns a new State object that is a copy of the current State object.
- Return type
The copy method is returning a new instance of the State class, which is a copy of the current
instance.
-