import torch
def computePower(waveform):
return torch.sum(torch.absolute(waveform) ** 2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* It's exceedingly rare that there is ever a single instance (when you consider testing as well). | |
* If there REALLY is just a single instance, it can just be a static member in some globals class, ex: | |
*/ | |
public final class Globals { | |
//set me as soon as possible while initializing the application I guess | |
public static State state; | |
} | |
/* The way it would ideally would work with dependency injection is that each class that actually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aspectj> | |
<aspects> | |
<aspect name="com.yourcompany.yourpackage.MethodLogger"/> | |
</aspects> | |
<weaver options="-XnoInline"> | |
<!--Note: the two .. are really important --> | |
<include within="com.yourcompany..*"/> | |
</weaver> | |
</aspectj> |