cancel einops

This commit is contained in:
Patrick von Platen 2022-06-27 15:39:41 +00:00
parent 4e08e0ca42
commit 932ce05d97
5 changed files with 13 additions and 24 deletions

View File

@ -13,13 +13,6 @@ from .embeddings import get_timestep_embedding
from .resnet import Upsample from .resnet import Upsample
# try:
# from einops import rearrange, repeat
# except:
# print("Einops is not installed")
# pass
def exists(val): def exists(val):
return val is not None return val is not None

View File

@ -17,7 +17,6 @@ from ..modeling_utils import ModelMixin
# pass # pass
class SinusoidalPosEmb(nn.Module): class SinusoidalPosEmb(nn.Module):
def __init__(self, dim): def __init__(self, dim):
super().__init__() super().__init__()

View File

@ -11,11 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from typing import Union
import numpy as np import numpy as np
import torch import torch
from typing import Union
SCHEDULER_CONFIG_NAME = "scheduler_config.json" SCHEDULER_CONFIG_NAME = "scheduler_config.json"
@ -53,11 +53,7 @@ class SchedulerMixin:
raise ValueError(f"`self.tensor_format`: {self.tensor_format} is not valid.") raise ValueError(f"`self.tensor_format`: {self.tensor_format} is not valid.")
def match_shape( def match_shape(self, values: Union[np.ndarray, torch.Tensor], broadcast_array: Union[np.ndarray, torch.Tensor]):
self,
values: Union[np.ndarray, torch.Tensor],
broadcast_array: Union[np.ndarray, torch.Tensor]
):
""" """
Turns a 1-D array into an array or tensor with len(broadcast_array.shape) dims. Turns a 1-D array into an array or tensor with len(broadcast_array.shape) dims.

View File

@ -21,7 +21,8 @@ import unittest
import numpy as np import numpy as np
import torch import torch
from diffusers import ( # GradTTSPipeline, from diffusers import (
GradTTSPipeline,
BDDMPipeline, BDDMPipeline,
DDIMPipeline, DDIMPipeline,
DDIMScheduler, DDIMScheduler,