sugarme/gotch

`*ts.CModule` does not implement `ts.Module` interface correctly

GoosvandenBekerom opened this issue · 0 comments

This GoDoc comment

gotch/ts/jit.go

Line 1188 in f45f0a7

// Forwad implements Module interface for CModule.

Implies that *ts.CModule implements the ts.Module interface.

type Module interface {
	// ModuleT
	Forward(xs *Tensor) *Tensor
}

But since it returns an error, it does not, not sure if this is an issue, but just something I noticed while trying to use CModule as a Module.

// Forwad implements Module interface for CModule.
func (cm *CModule) Forward(tensor *Tensor) (*Tensor, error) {

	var tensors []*Tensor = []*Tensor{tensor}
	return cm.ForwardTs(tensors)
}