Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pytext/fields/char_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@


class CharFeatureField(VocabUsingField):
dummy_model_input = torch.tensor(
[[[1, 1, 1]], [[1, 1, 1]]], dtype=torch.long, device="cpu"
)
dummy_model_input = None # torch.tensor(
# [[[1, 1, 1]], [[1, 1, 1]]], dtype=torch.long, device="cpu"
# )

def __init__(
self,
Expand Down
10 changes: 5 additions & 5 deletions pytext/fields/dict_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class DictFeatureField(VocabUsingField):
dummy_model_input = (
torch.tensor([[1], [1]], dtype=torch.long, device="cpu"),
torch.tensor([[1.5], [2.5]], dtype=torch.float, device="cpu"),
torch.tensor([[1], [1]], dtype=torch.long, device="cpu"),
)
dummy_model_input = None # (
# torch.tensor([[1], [1]], dtype=torch.long, device="cpu"),
# torch.tensor([[1.5], [2.5]], dtype=torch.float, device="cpu"),
# torch.tensor([[1], [1]], dtype=torch.long, device="cpu"),
# )

def __init__(
self,
Expand Down
6 changes: 4 additions & 2 deletions pytext/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_meta(self):


class TextFeatureField(VocabUsingField):
dummy_model_input = torch.tensor([[1], [1]], dtype=torch.long, device="cpu")
dummy_model_input = None # torch.tensor([[1], [1]], dtype=torch.long, device="cpu")

def __init__(
self,
Expand Down Expand Up @@ -220,7 +220,9 @@ def __init__(


class SeqFeatureField(VocabUsingNestedField):
dummy_model_input = torch.tensor([[[1]], [[1]]], dtype=torch.long, device="cpu")
dummy_model_input = (
None # torch.tensor([[[1]], [[1]]], dtype=torch.long, device="cpu")
)

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion pytext/optimizer/privacy_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import List, Optional

import opacus
# import opacus
from pytext.config import ConfigBase
from pytext.config.component import Component, ComponentType

Expand Down
2 changes: 1 addition & 1 deletion pytext/utils/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def log_class_usage(klass):
identifier = "PyText"
if klass and hasattr(klass, "__name__"):
identifier += f".{klass.__name__}"
torch._C._log_api_usage_once(identifier)
# torch._C._log_api_usage_once(identifier)