tensor_utils¶
Functions
- cast_to_tensor(x)[source]¶
Converts scalars or lists of scalars into tensors, and combines lists of tensors into a single tensor. All other input types are returned unchanged. Returned tensors are always of shape [1,N,D] where D is dimension and N is the number of tensors combined.
- concat_dicts(kwargs)[source]¶
Concatenates a list of dicts sharing the same keys, the resulting dictionary has the same keys and concatenated values.
- prepare_kwargs(self, func, args, kwargs, initial_args, unique_args)[source]¶
Combine args and kwargs into one dict, using default values where arg is missing