You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I run into two issues when impl'ing TensorCollection:
Minor issue: TensorCollection assumes the module can be constructed from purely the Tensor values and nothing else, meaning I actually need to refactor the struct to remove metadata, which is inconvenient.
Major issue: To register logits when calling visitor.visit_fields I need to call Self::tensor, which expects a TensorOptions. But, TensorOptions can only be constructed if S: ConstShape as that is assumed by all the construction methods and TensorOptions is marked non-exhaustive. But even if this were relaxed I wouldn't be able to construct logits without knowing its (runtime) shape, which I'm unable to determine given the limited context allowed by the signature.
Is this a correct diagnosis of the limitations of the module API?
If so, do you suggest a workaround?
The text was updated successfully, but these errors were encountered:
I'd like to create a module from a struct like this:
However, I run into two issues when impl'ing
TensorCollection
:TensorCollection
assumes the module can be constructed from purely the Tensor values and nothing else, meaning I actually need to refactor the struct to removemetadata
, which is inconvenient.logits
when callingvisitor.visit_fields
I need to callSelf::tensor
, which expects aTensorOptions
. But,TensorOptions
can only be constructed ifS: ConstShape
as that is assumed by all the construction methods andTensorOptions
is marked non-exhaustive. But even if this were relaxed I wouldn't be able to constructlogits
without knowing its (runtime) shape, which I'm unable to determine given the limited context allowed by the signature.Is this a correct diagnosis of the limitations of the module API?
If so, do you suggest a workaround?
The text was updated successfully, but these errors were encountered: