Skip to content
Merged
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
19 changes: 12 additions & 7 deletions aten/src/ATen/native/mps/OperationUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,21 @@ MPSDataType getMPSScalarType(ScalarType scalar_type) {
switch (scalar_type) {
case ScalarType::Double:
case ScalarType::Float:
return "MPSDataTypeFloat32";
return "Float32";
case ScalarType::Half:
return "MPSDataTypeFloat16";
return "Float16";
case ScalarType::Int:
return "MPSDataTypeInt32";
return "Int32";
case ScalarType::Long:
return "MPSDataTypeInt64";
return "Int64";
case ScalarType::Short:
return "MPSDataTypeInt16";
return "Int16";
case ScalarType::Char:
return "UInt8";
case ScalarType::Byte:
return "MPSDataTypeInt8";
return "Int8";
case ScalarType::Bool:
return "MPSDataTypeBool";
return "Bool";
default:
return "Undefined";
}
Expand Down Expand Up @@ -316,6 +318,9 @@ void printTensorNDArray(const Tensor& t) {
case MPSDataTypeInt8:
v.i = scalar.to<int8_t>();
break;
case MPSDataTypeUInt8:
v.i = scalar.to<uint8_t>();
break;
case MPSDataTypeBool:
v.b = scalar.to<bool>();
break;
Expand Down
6 changes: 1 addition & 5 deletions aten/src/ATen/native/mps/operations/Distributions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
#include <ATen/NativeFunctions.h>
#include <ATen/AccumulateType.h>
#include <torch/library.h>

namespace at {
namespace native {
namespace templates {

}

Tensor& uniform_mps_(Tensor& input, double from, double to, c10::optional<Generator> gen_)
{
Expand Down Expand Up @@ -717,8 +715,6 @@ static void check_from_to_in_range(int64_t from, int64_t to_inc, ScalarType scal
c10::optional<Generator> gen,
Tensor& result) {

std::cout<<"Multinomial MPS\n";

TORCH_CHECK(
result.device() == self.device(),
"multinomial arguments must have the same device");
Expand Down