Documentation
¶
Index ¶
- func ArgMax(s []float32) (int, float32, error)
- func CloseFile(file io.Closer) error
- func CopyFile(from string, to string) error
- func CreateFile(fileName string, isDir bool) error
- func DeleteFile(filename string) error
- func FileExists(filename string) (bool, error)
- func GetPathType(path string) string
- func Mean(vector []float32) float32
- func MoveFile(from string, to string) error
- func NewFileWriter(filename string, contentType string) (io.WriteCloser, error)
- func Norm(v []float32, p int) float64
- func Normalize(embedding []float32, p int) []float32
- func OpenFile(filename string) (io.ReadCloser, error)
- func PathJoinSafe(elem ...string) string
- func ReadFileBytes(filename string) ([]byte, error)
- func ReadLine(r *bufio.Reader) ([]byte, error)
- func Sigmoid(s []float32) []float32
- func SoftMax(vector []float32) []float32
- func SumSlice(s []float64) float64
- func WalkDir() func(ctx context.Context, URL string, handler storage.OnVisit, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶ added in v0.3.2
func DeleteFile ¶ added in v0.3.2
func FileExists ¶ added in v0.3.2
func GetPathType ¶
func NewFileWriter ¶ added in v0.3.2
func NewFileWriter(filename string, contentType string) (io.WriteCloser, error)
func Normalize ¶
Normalize single vector according to: https://pytorch.org/docs/stable/generated/torch.nn.functional.normalize.html
func PathJoinSafe ¶
PathJoinSafe wrapper around filepath.Join to ensure that paths are correctly constructed if the path is a normal OS path, just use filepath.Join if the path is S3, trim any trailing slashes and construct it manually from the components so that double slashes (e.g. s3://) are preserved.
func ReadFileBytes ¶
func ReadLine ¶ added in v0.3.0
ReadLine returns a single line (without the ending \n) from the input buffered reader. An error is returned if there is an error with the buffered reader. This function is needed to avoid the 65K char line limit
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.