Documentation ¶
Index ¶
- func AssertType[T any](v any) (vt T, err error)
- func AssignAssertedType[T any](v any, to *T) (err error)
- func AssignDictToMap[K comparable, V any](d *types.Dict, m *map[K]V) (err error)
- func AssignListToSlice[T any](l *types.List, s *[]T) (err error)
- func AssignOptionalAssertedType[T any](v any, to **T) (err error)
- func AssignTupleToSlice[T any](t *types.Tuple, s *[]T) (err error)
- func DictToMap[K comparable, V any](d *types.Dict) (map[K]V, error)
- func GetTensorData(t *pytorch.Tensor) ([]float32, error)
- func ListToSlice[T any](l *types.List) ([]T, error)
- func Tensor2DToSliceOfVectors(t *pytorch.Tensor) ([]mat.Matrix, error)
- func TupleToSlice[T any](t *types.Tuple) ([]T, error)
- type PyAttributeGettable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertType ¶
func AssignAssertedType ¶
func AssignDictToMap ¶
func AssignDictToMap[K comparable, V any](d *types.Dict, m *map[K]V) (err error)
func GetTensorData ¶
GetTensorData returns the data of a PyTorch tensor as a mat.Float slice. It returns the data using the row-major representation, possibly converting column-major order to row-major order.
Types ¶
Click to show internal directories.
Click to hide internal directories.