本文簡要介紹python語言中 torch.distributions.constraint_registry.ConstraintRegistry.register 的用法。
用法:
register(constraint, factory=None)constraint(子類
Constraint) -Constraint的子類,或所需類的單例對象。factory(可調用的) -輸入約束對象並返回
Transform對象的可調用對象。
在此注冊表中注冊
Constraint子類。用法:@my_registry.register(MyConstraintClass) def construct_transform(constraint): assert isinstance(constraint, MyConstraint) return MyTransform(constraint.arg_constraints)
參數:
相關用法
- Python PyTorch ConstantPad2d用法及代碼示例
- Python PyTorch ConstantLR用法及代碼示例
- Python PyTorch ConstantPad1d用法及代碼示例
- Python PyTorch ConstantPad3d用法及代碼示例
- Python PyTorch ConvTranspose3d用法及代碼示例
- Python PyTorch Conv1d用法及代碼示例
- Python PyTorch ContinuousBernoulli用法及代碼示例
- Python PyTorch ConvTranspose2d用法及代碼示例
- Python PyTorch Concater用法及代碼示例
- Python PyTorch Conv2d用法及代碼示例
- Python PyTorch Conv3d用法及代碼示例
- Python PyTorch Collator用法及代碼示例
- Python PyTorch CosineAnnealingWarmRestarts.step用法及代碼示例
- Python PyTorch CocoCaptions用法及代碼示例
- Python PyTorch ComplexNorm用法及代碼示例
- Python PyTorch Compose用法及代碼示例
- Python PyTorch CosineSimilarity用法及代碼示例
- Python PyTorch CSVParser用法及代碼示例
- Python PyTorch CrossEntropyLoss用法及代碼示例
- Python PyTorch ChannelShuffle用法及代碼示例
- Python PyTorch CSVDictParser用法及代碼示例
- Python PyTorch Cityscapes用法及代碼示例
- Python PyTorch ChainedScheduler用法及代碼示例
- Python PyTorch Cauchy用法及代碼示例
- Python PyTorch CriteoIterDataPipe用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.distributions.constraint_registry.ConstraintRegistry.register。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
